![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||
| ||||
|
|
Hello guys and gals. I know nothing about programming in Javascript at present and was wondering if you could help me. |
|
Basically I have a function called 'showhide' and I have a variable passed from the previous page to the current page. |
|
The variable is called 'flash' and flash=1 if the user has selected to view the site without flash movies. 'showhide' simply removes the Flash movie from the page. |
|
Anyway, so the variable 'flash=1' is passing from the previous page successfully as I can see it in the URL. What I'd like to know is what code to use to run the function 'showhide' if flash=1. |
#3
| |||
| |||
|
|
Miner Willy said the following on 2/4/2006 9:26 AM: Hello guys and gals. I know nothing about programming in Javascript at present and was wondering if you could help me. The best "help" you could get would be to be told to read the manual. Basically I have a function called 'showhide' and I have a variable passed from the previous page to the current page. Whats the function code? The variable is called 'flash' and flash=1 if the user has selected to view the site without flash movies. 'showhide' simply removes the Flash movie from the page. Do it the other way. Instead of removing the Flash movie, add it. Anyway, so the variable 'flash=1' is passing from the previous page successfully as I can see it in the URL. What I'd like to know is what code to use to run the function 'showhide' if flash=1. Check the queryString for flash=1 and if it is there, add the flash movie. alert(document.location.queryString) -- Randy comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/ |
#4
| |||
| |||
|
|
Cheers mate - but that doesn't really help me at all. I have no knowledge of Javascript, and have no interest in learning it - I just have the need to use a script for this. All I need is a couple of lines of arbitrary code to call a function if a variable = 1. This is for online learning content in a remote area with limited access to one to one tuition. I'm not trying to make a million off somebody else's code. If anybody could post an answer that would be great. Thanks. |
#5
| |||
| |||
|
|
Miner Willy said the following on 2/4/2006 7:39 PM: Cheers mate - but that doesn't really help me at all. I have no knowledge of Javascript, and have no interest in learning it - I just have the need to use a script for this. All I need is a couple of lines of arbitrary code to call a function if a variable = 1. This is for online learning content in a remote area with limited access to one to one tuition. I'm not trying to make a million off somebody else's code. If anybody could post an answer that would be great. Thanks. if (document.location.indexOf('flash=1'){showhide();} There ya go. -- Randy comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/ Answer:It destroys the order of the conversation Question: Why? Answer: Top-Posting. Question: Whats the most annoying thing on Usenet? |
![]() |
| Thread Tools | |
| Display Modes | |
| |