Results 1 to 3 of 3
Related
-
Passing variables to external PHP Javascript page Forum: PHP Forum
Replies: 0 -
Javascript function call Forum: Javascript Forum
Replies: 1 -
[SPLIT]passing values to an external .js file Forum: Javascript Forum
Replies: 37 -
passing values to an external .js file Forum: Javascript Forum
Replies: 10
-
05-08-2007, 02:09 AM #1
call external Javascript(PHP) with passing value
Hi everyone,
Previously I was using this code and it work perfectly fine:
Code:<SCRIPT LANGUAGE="Javascript" SRC="../count.php?page=Home"><!-- //--></SCRIPT>
I tried to:
1)Code:<SCRIPT LANGUAGE="Javascript" SRC="../count.php?page=Home&from=" + var ><!-- //--></SCRIPT>
Code:<SCRIPT LANGUAGE="Javascript"><!-- if ( frm == "xx") { <SCRIPT LANGUAGE="Javascript" SRC="../count.php?page=Home&from=xx"><!-- //--></SCRIPT> }else{ <SCRIPT LANGUAGE="Javascript" SRC="../count.php?page=Home"><!-- //--></SCRIPT> //--></SCRIPT>
-
05-08-2007, 03:13 AM #2
Re: call external Javascript(PHP) with passing value
The <SCRIPT... tag tells the parser that what follows will be a script. LANGUAGE tells the parser what language it will be, and SRC where the csript is coming from.
Until the browser has finished parsing the whole of the <SCRIPT> tag, it is still in HTML and therefore you can't use code.
Don't know how you'd get around this in html, but if you're generating the page from PHP you'd usePHP Code:echo "<SCRIPT LANGUAGE=\"Javascript\" SRC=\"../count.php?page=Home&from=" . $var . " ><!--\n";
echo "\t//--></SCRIPT>\n";
-
05-15-2007, 06:28 AM #3
Re: call external Javascript(PHP) with passing value
Really appreciate your help but I am not using php on my main site.
Actually, this mainpage will call a php file to do a 'hitcount' but now I am trying to make it to skip the increament when the user is coming from a certain page. That's why other page will pass a value with "?from=xxx" in the URL when calling that mainpage. Then, this mainpage need to pass the parameter to the php file when calling the counter file(php) (as shown from my previous post for the code). When the counter(php) check the parameter, it will decide to increase or just display the number.
Any idea other than this way?
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum