JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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 September 27th, 2012, 03:12 PM
shera10002000 shera10002000 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 1 shera10002000 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 42 sec
Reputation Power: 0
Red face Fetch value from another javascript

Parent XUL triggers script2.js, after modal-xul(used for authentication and capturing username) is done with script1.js. So issue is when script2.js triggers, how does it get the value set in app. the alert in script2.js goes into error

script1.js

Code:
var app;
function method1() {
    var username = document.getElementById('username').value;
    app = new UserText();
    app.setValue(username);
    // more logic
}


script2.js

Code:
alert(app.getValue());

Reply With Quote
  #2  
Old October 1st, 2012, 02:49 PM
gsharp gsharp is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 9 gsharp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 6 m 10 sec
Reputation Power: 0
You can access variables/functions from other javascript files. How are you including the files? Are you calling method1 before including script2.js?

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Fetch value from another javascript

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap