read js file
-
ex:
now here: i want to check if the javascript file returned something or not on the same page. i.e: alert(document.getElementbyId("hi").innerHTML); here the alert will show this: "" now, How can i get the value that returns from the script file??
Faris Madi Nothing Comes Easy (N.C.E.)
-
ex:
now here: i want to check if the javascript file returned something or not on the same page. i.e: alert(document.getElementbyId("hi").innerHTML); here the alert will show this: "" now, How can i get the value that returns from the script file??
Faris Madi Nothing Comes Easy (N.C.E.)
Using a src in your tag or placing the code between the open and close <script> tag, causes the code to be executed, but there is no default return value. However, the script can include functions and execute them, in which case the function is said to have a return value, if it contains a return statement and the function's return value is assigned to something, like a variable or the value property of an HTML textbox component. <pre><code><input type="text" id="textbox" value=""> <script language="javascript"> function func() { return "hi!" } textbox.value = func();
-
Using a src in your tag or placing the code between the open and close <script> tag, causes the code to be executed, but there is no default return value. However, the script can include functions and execute them, in which case the function is said to have a return value, if it contains a return statement and the function's return value is assigned to something, like a variable or the value property of an HTML textbox component. <pre><code><input type="text" id="textbox" value=""> <script language="javascript"> function func() { return "hi!" } textbox.value = func();
actully i don't have enough imformation about the script or the function name. all i got is a link to the script where i can pass my parameters for example: and the returned result shall be displayed where i script line found. and what i want to do is: i have two scripts: if the first script did not return anything, then i should call the second script, and vice versa... Faris Madi Nothing Comes Easy (N.C.E.)