![]() |
|
|
Dectecting if Javascript is enabled |
|
Super Talker
Posts: 115
Location: California
|
I basically want to end the loading of a page if javascripting is disabled. Yes I pretty much want to show blank pages to users who have not detected JavaScripting.
I thought about including a php tag using exit; in a noscript tag Code:
<noscript> <?php echo 'This page REQUIRES JavaScripting to be enabled'; exit;?> </noscript> My question is will the server parse the php tag when it encounters it or will it only parse the php tag when the noscript tag is used when a visitor's JavaScripting is disabled?
__________________
Check out my Cliff Diving website! |
|
|
|
| Sponsored Links (We share ad revenue): |
|
|
Re: Dectecting if Javascript is enabled |
|
Cheerleader
Posts: 1,626
Location: Guildford, UK
|
What you need to bear in mind is the order in which things are done on the web. The PHP Script is parsed by the server before the resulting HTML is even sent to the browser. Therefore, tags such as <noscript> have no effect at the time the PHP is being parsed. Think of any HTML outside the <? ?> tags as being echo'd by PHP, i.e.
Code:
__________________
Minaki Serinde MCP "Wow, Linux is nearly on-par with Windows ME!" Inoxia Pyrotechnics Supplies | Surrey Angels Cheerleading Squad Last edited by Minaki : 07-04-2006 at 05:45 AM. |
|
|
|
|
|
Re: Dectecting if Javascript is enabled |
|
Super Talker
Posts: 115
Location: California
|
Wow the more I learn about JavaScript the more I would rather use PHP.
My problem I wanted to use JS to read this XML data onto a webpage Code:
<userlist> <member> <name>Bob Jones</name> <motto>Every day in every way I get better & better!</motto> <id_number>1369420</id_number> </member> </userlist>
__________________
Check out my Cliff Diving website! |
|
|
|
|
|
Re: Dectecting if Javascript is enabled |
|
Junior Talker
Posts: 3
Name: jon
|
I have some code which detects javascript with php.
It can be found at http://snippets.bluejon.co.uk/ blujon |
|
|
|
|
|
Re: Dectecting if Javascript is enabled | |
|
Fetchez la vache!
Latest Blog Post:
Pretty pretty please…. Posts: 1,705
Name: Thierry
Location: In the void
|
Quote:
When you do things in your little corner, it might by overkill, but as soon as you need to exchange datas between differen systems (or applications) you don't manage, it's literraly a savior. Probably you are throwing it because you were not using it in the right situation, or with the good approach, but trust me, it's VERY easy and fast to alter it to render nearly anything. I develop every sites I do with XML and XSLT, and it does have reduced the templating and code handling time I spent on my pages. And by the way, if you have heard about the DOM tree of your browser (you know, that thingy firefox include to let you inspect the source of a web page) ? Well, it's pure XML. Javascript DOM functions are supported in every browser since IE 5.5 (he was the first) and since then almost every modern web browser can create a web page receiving XML and XSL.
__________________
Listen to the ducky: "This is awesome!!!" |
|
|
|
|
| Sponsored Links (We share ad revenue): |
| Thread Tools | |
|
|
| Webmaster Resources Marketplace: |
| Software Development Company | Webhosting.UK.com |
| Web Templates | Text Link Brokers | Stock Photos |