Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Detect For Non Javascript enabled users, and Warn them!

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 12-20-2002, 03:18 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default Detect For Non Javascript enabled users, and Warn them!

I put this in [skin1]/customer/home.tpl after my </head> tag.

Code:
<noscript> <p align="center"><FONT COLOR="#FF0000" SIZE="-1">*** ERROR JAVASCRIPT IS REQUIRED TO USE THIS SITE! ***</FONT></p> <hr size=1> <p align="center"> How to Enable/Disable JavaScript</p> The following describes how to enable JavaScripts in Internet Explorer, Netscape Navigator and AOL browsers. To disable JavaScript, follow the same step, but uncheck the JavaScript options that you set when you enabled JavaScript. Internet Explorer 5.X
  1. Open Internet Explorer.
  2. Select Internet Options from the Tools menu.
  3. In Internet Options dialog box select the Security tab.
  4. Click Custom level button at bottom right. The Security settings dialog box will pop up.
  5. Under Scripting category check Active Scripting, Allow paste options via script and Scripting of Java applets
  6. Check radio boxes.
  7. Click OK twice to close out.
Internet Explorer 4.0:
  1. Select Internet Options from the View menu
  2. click the Secutity tab
  3. click Custom
  4. click Settings
  5. scroll down to locate Scripting
  6. click Enable for Active Scripting
  7. click OK, then click the Reload button
Internet Explorer 3.xx:
  1. Select Options from the View menu
  2. click Security
  3. check Enable Java Programs
  4. Click
  5. OK, then click the
  6. Reload button
Netscape 4.0 or higher:
  1. Select Preferences from the Edit menu
  2. click Advanced
  3. check in both Enable Java and Enable JavaScript
  4. click OK
Netscape 3.0:
  1. Select Options from the Edit menu
  2. click Network Preferences
  3. click Languages
  4. check both Enable Java and Enable JavaScript
  5. click OK
4.0 and 5.0:
  1. Click My AOL
  2. click Preferences
  3. click WWW
  4. click the Secutity tab
  5. click Custom
  6. click Settings
  7. scroll down to locate Scripting
  8. click Enable for Active Scripting
  9. click OK, then click the Reload button
Note to AOL 4.0 & 5.0 users When using the use AOL browser, you may get a Java script error but, when using an external browser (i.e., Netscape or IE) this does not occur. AOL uses compressed graphics by Default. This doesn't allow Java to work while browsing inside AOL. (This also makes photos you view on web pages look less than their best.) Do the following:
  1. Click My AOL
  2. Click Preferences
  3. Click the WWW icon
  4. Click Web Graphics tab
  5. Uncheck the box next to Use Compressed Graphics
  6. Click OK Restart the computer.
Note that there are both 16-bit and 32-bit versions of AOL 4.0. Only the 32-bit version has full Java capabilites. AOL 3.0:
  1. Click Prefs
  2. Click Security
  3. Check Enable Java Programs, if the box is blank, single click on it.
  4. Click OK
  5. Click the browser's back button, once back, click reload.
</noscript>

This should really ALREADY be implemented into the templates on install, since 10% of the total net population has it disabled, makes x-cart for any customer browsing your site with it disabled, utterly annoyoed because x-cart is so heavily based on javascript.

I was trying to add a {php}exit;{/php} before </noscript> but it triggers anyhow. Anyone know a way to make the templates stop parsing?

Happy holidays!
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #2  
Old 12-20-2002, 03:24 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

http://www.thecounter.com/stats/2002/November/javas.php
10% lost customers
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 12-23-2002, 12:31 AM
 
rrf rrf is offline
 

X-Cart team
  
Join Date: Sep 2002
Posts: 543
 

Default

JavaScript is needed in X-Cart for lot of advanced features. However, in the next release of X-Cart we will make sure that at least _basic_ features will work even if a customer does not have JavaScript enabled.
__________________
Sincerely yours,
Ruslan R. Fazliev,
CEO

Twitter: @aznakai
Reply With Quote
  #4  
Old 03-06-2003, 03:00 AM
 
mickna mickna is offline
 

Newbie
  
Join Date: Feb 2003
Location: Munich, germany
Posts: 6
 

Default

THX Boomer! Nice!

However I think it's a little more comfortable to put the code outside the head.tpl (speed, language)

I did this:

Insert in home.tpl:
--------------------------snip


<noscript>
{if $store_language eq "DE"}
{ include file="customer/nojava_ger.tpl" }
{elseif $store_language eq "US"}
{ include file="customer/nojava_engl.tpl" }
{else}
{ include file="customer/nojava_engl.tpl" }
{/if}
</noscript>


-------------------------snip

Put your code (only the explanasion of course ) in a extra tpl-file under customer/nojava_engl.tpl for user who was prev. here and enabled javascript. The same for German and the last line ( after {else} ) for default (here english again)

So the home.tpl is shorter to read I think and you can handel which language....

Cheers,
mickna
Reply With Quote
  #5  
Old 03-31-2003, 11:16 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

What about netscape 7.0 users
Reply With Quote
  #6  
Old 03-31-2003, 12:41 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Nutscrape

http://www.thecounter.com/stats/2002/November/browser.php
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #7  
Old 03-31-2003, 12:51 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Wow, people on netscape 1 !!

I mean if they are using netscape 7.0 you have no instructions on how to activate java
Reply With Quote
  #8  
Old 05-07-2003, 05:26 PM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default

Perusing through the forums I discovered this simple but very nice mod. Thanks Boomer!

I implemented it using the method mickna described.

I have updated the content of the file to better reflect current browsers as well as some corrections for language, spelling, layout, and etcetera.

The following browsers are included in the information below:

Mozilla 1.X
Opera 5.X
Opera 7.X
Safari Public Beta 2 for MACOSX
Internet Explorer 3.X
Internet Explorer 4.X
Internet Explorer 5.X
Internet Explorer 5.X for MACOSX
Internet Explorer 5 for MACOS9
Internet Explorer 6.X
Netscape 3.X
Netscape 4.X
Netscape 4.X for MACOS9
Netscape 6.X for MACOSX
Netscape 7.X
AOL 3.0
AOL 4.0 and 5.0

The resulting code for a file called skin1/customer/no_javascript.tpl:

Code:
<center> <table bgcolor="white" width="80%" cellpadding="5"><tr><td> <p align="center"><FONT COLOR="#FF0000" SIZE="-1">*** ERROR *** JAVASCRIPT IS REQUIRED TO USE THIS SITE! </FONT></p> <p align="center"> How to Enable/Disable JavaScript <a name=Top></a> The following instructions describe how to set JavaScript options for: Mozilla, Opera, Safari, Explorer, Netscape, and AOL browsers.</p> <hr> <a name="Mozilla">Mozilla 1.X </a>
  1. Open Mozilla.
  2. Select Preferences from the Edit menu.
  3. Click the arrow next to Advanced.
  4. Click Scripts &amp; Plugins.
  5. Check Navigator beneath "Enable Javascript for".
  6. Click OK.
  7. Click Reload.
<hr noshade size=1><div align="right">Back to Top</div> <a name="Opera">Opera 5.X</a>
  1. Open Opera.
  2. Select Quick Preferences from the File menu.
  3. Make sure Enable Javascript is checked.
  4. Click Reload.
Opera 7.X
  1. Open Opera.
  2. Select Quick Preferences from the File menu.
  3. Make sure Enable Javascript is checked.
  4. Click Reload.
<hr noshade size=1><div align="right">Back to Top</div> <a name="Safari">Safari Public Beta 2 for MACOSX </a>
  1. Open Safari.
  2. Select Preferences from the Safari menu.
  3. Click Security.
  4. Check both Enable Java and Enable JavaScript.
  5. Close the window.
  6. Click Reload.
<hr noshade size=1><div align="right">Back to Top</div> <a name="IE">Internet Explorer 3.X</a>
  1. Select Options from the View menu.
  2. Click Security.
  3. Check Enable Java Programs.
  4. Click OK.
  5. Click Reload.
Internet Explorer 4.X
  1. Select Internet Options from the View menu.
  2. Click the Security tab.
  3. Click Custom.
  4. Click Settings.
  5. Scroll down to locate Scripting.
  6. Click Enable for Active Scripting.
  7. Click OK.
  8. Click Reload.
Internet Explorer 5.X
  1. Open Internet Explorer.
  2. Select Internet Options from the Tools menu.
  3. In Internet Options dialog box select the Security tab.
  4. Click Custom level button at bottom. The Security Settings dialog box will pop up.
  5. Under Scripting category enable Active Scripting, Allow paste options via script and Scripting of Java applets
  6. Click OK twice to close out.
  7. Hit Refresh.
Internet Explorer 5.X for MACOSX
  1. Open Internet Explorer.
  2. Select Preferences from the Explorer menu.
  3. Click the arrow next to Web Browser.
  4. Click Web Content.
  5. Under Active Content check Enable Scripting.
  6. Click OK.
  7. Click Refresh.
Internet Explorer 5 for MACOS9
  1. Open Internet Explorer.
  2. Select Preferences from the Edit menu.
  3. Click the arrow next to Web Browser.
  4. Click Web Content.
  5. Under Active Content check Enable Scripting.
  6. Click OK.
  7. Click Refresh.
Internet Explorer 6.X
  1. Open Internet Explorer.
  2. Select Internet Options from the Tools menu.
  3. In Internet Options dialog box select the Security tab.
  4. Click Custom level button at bottom. The Security settings dialog box will pop up.
  5. Under Scripting category enable Active Scripting, Allow paste options via script and Scripting of Java applets
  6. Click OK twice to close out.
  7. Hit Refresh.
<hr noshade size=1><div align="right">Back to Top</div> <a name="Netscape">Netscape 3.X </a>
  1. Select Options from the Edit menu.
  2. Click Network Preferences.
  3. Click Languages.
  4. Check both Enable Java and Enable JavaScript.
  5. Click OK.
  6. Click Reload.
Netscape 4.X
  1. Open Netscape.
  2. Select Preferences from the Edit menu.
  3. Click Advanced.
  4. Check both Enable Java and Enable JavaScript
  5. Click OK.
  6. Click Reload.
Netscape 4.X for MACOS9
  1. Open Netscape.
  2. Select Preferences from the Edit menu.
  3. Click Advanced.
  4. Check both Enable Java and Enable JavaScript
  5. Click OK.
  6. Click Reload.
Netscape 6.X for MACOSX
  1. Open Netscape.
  2. Select Preferences from the Edit menu.
  3. Click Advanced
  4. Check both Enable Java and Enable JavaScript for Navigator
  5. Click OK.
  6. Click Reload.
Netscape 7.X
  1. Open Netscape.
  2. Select Preferences from the Edit menu.
  3. Click the arrow next to Advanced.
  4. Click Scripts &amp; Plugins.
  5. Check Navigator beneath "Enable Javascript for".
  6. Click OK.
  7. Click Reload.
<hr noshade size=1><div align="right">Back to Top</div> <a name="AOL">AOL 3.0 </a>
  1. Click Prefs.
  2. Click Security.
  3. Check Enable Java Programs, if the box is blank, single click on it.
  4. Click OK .
  5. Click the browser's back button, once back, click reload.
AOL 4.0 and 5.0
  1. Click My AOL.
  2. Click Preferences.
  3. Click WWW.
  4. Click the Secutity tab.
  5. Click Custom.
  6. Click Settings.
  7. Scroll down to locate Scripting.
  8. Click Enable for Active Scripting.
  9. Click OK, then click the Reload button.
Note to AOL 4.0 & 5.0 users When using the use AOL browser, you may get a Javascript error but, when using an external browser (i.e., Netscape or Internet Explorer) this does not occur. AOL uses compressed graphics by Default. This doesn't allow Java to work while browsing inside AOL. (Additionally, this makes photos you view on web pages look less than optimal.) Do the following:
  1. Click My AOL.
  2. Click Preferences.
  3. Click the WWW icon.
  4. Click Web Graphics tab.
  5. Uncheck the box next to Use Compressed Graphics.
  6. Click OK Restart the computer.
Note that there are both 16-bit and 32-bit versions of AOL 4.0. Only the 32-bit version has full Java capabilites. <hr noshade size=1><div align="right">Back to Top</div> </td></tr></table> </center>


The code for skin1/customer/home.tpl (placed beneath the <Body> tag):

Code:
<noscript> { include file="customer/no_javascript.tpl" } </noscript>

__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #9  
Old 05-07-2003, 05:33 PM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default

Just to make life a bit easier I uploaded an HTML version for your viewing pleasure:

http://www.boomboombap.com/no_javascript.html

Cheers !

:P
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #10  
Old 05-09-2003, 12:36 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Is it safe to do:

<script>
all the original content
</script>
<noscript>
{ include file="nojava.tpl" }
</noscript>

So that you get one or the other but not both?
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:18 AM.

   

 
X-Cart forums © 2001-2020