Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 2nd, 2005, 04:58 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP code for enabling javascript

Hi
I have to write a code enable javascript if it is disabled in the browser, because sometimes this happens that javascript is disabled in some browser like Mozilla,I have to write the code to first detect the enability of javascript and it must give some alert message or atomatically change this to javascript enable.

Thanks
Lily

 
Old March 2nd, 2005, 03:59 PM
Authorized User
 
Join Date: Aug 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sherief Send a message via Yahoo to sherief
Default

Hi Lily,

I don't think there is any ASP script can enable or disable javascript on client browser.

All that we can do is provide some javascript test, and tell users how to enable it if it disabled.

Regards,
Sherief C. Mursyidi
 
Old March 3rd, 2005, 02:51 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can u give the code to test javascript with ASP code.

 
Old March 3rd, 2005, 04:48 AM
Authorized User
 
Join Date: Aug 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sherief Send a message via Yahoo to sherief
Default

All you have to do, just ask users to click on button or link that given onclick action using simple javascript, like alert.

simple example:
It is possible that JavaScript is disabled on your browser.
Select this <A HREF="javascript:alert('Javascript is enabled. You do not need to do anything.');"> to see if Javascript is enabled.
If nothing happened, you need to enable javascript.

Regards,
Sherief C. Mursyidi
 
Old March 7th, 2005, 12:17 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How this ll b possible to check in onclick action if javascript will be disabled?

 
Old March 7th, 2005, 07:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Something like this is never going to be easy in ASP because it runs at the server not the client. The best I've seen is provide a javascript redirect and test the result, something like this:
http://aspfaq.com/show.asp?id=2058
 
Old March 8th, 2005, 02:13 PM
Authorized User
 
Join Date: Aug 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sherief Send a message via Yahoo to sherief
Default

Lily, that's the point, if the user see nothing happen on the screen, they need to enable their browser.

Regards,
Sherief C. Mursyidi
 
Old March 10th, 2005, 09:28 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

hii Lily611

Offcourse you can check using asp code

try this example
http://www.w3schools.com/asp/asp_browser.asp
Hope this will help you


Cheers :)

vinod
 
Old March 10th, 2005, 09:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

vinod, the browscap link you suggested only tells whether the user's browser has support for javascript. it doesn't help you find out if javascript has been turned off...





Similar Threads
Thread Thread Starter Forum Replies Last Post
Access ASP code inside Javascript deean JSP Basics 1 June 20th, 2008 02:00 PM
Error while running javascript code in ASP.NET Pag fozia_izhar ASP.NET 1.0 and 1.1 Professional 2 December 20th, 2006 03:39 AM
In ASP,Client side javaScript code casimir Classic ASP XML 0 October 24th, 2005 12:24 AM
hiding javascript code using ASP pablohoney Classic ASP Basics 2 March 30th, 2005 10:58 AM
Javascript question in my ASP code savoym Classic ASP Basics 3 May 24th, 2004 06:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.