|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I want to pass a variable from a include file to a Javascript function which will be accessed by around 300 pages.
The url.txt contains url=123.123.123.80 I included it as: <!--#INCLUDE FILE="url.txt"--> When i tried to access function text(){ alert(url); window.open("url/text.asp)} This was not working.Can u pls send me the solution. |
|
#2
|
|||
|
|||
|
I think you need to do it like this -
Use this syntax to include your file, and make it a .js file - <script language="javascript" src="filename.js"></script> In your filename.js file do something like this - var url="10.0.0.16"; You should then be able to reference the url variable from the main page. Hope that helps! Matt. |
|
#3
|
|||
|
|||
|
Thanks a lot.It was very useful.
|
![]() |
| Viewing: Dev Shed Forums > Web Design > JavaScript Development > Including files in Javascript |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|