JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 27th, 2000, 08:02 AM
sunitha sunitha is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 2 sunitha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old October 30th, 2000, 06:33 AM
mmonks mmonks is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 27 mmonks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #3  
Old October 30th, 2000, 07:03 AM
sunitha sunitha is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 2 sunitha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks a lot.It was very useful.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Including files in Javascript


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT