Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. read js file

read js file

Scheduled Pinned Locked Moved Web Development
javascriptquestiontools
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    militiaware
    wrote on last edited by
    #1

    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.)

    H 1 Reply Last reply
    0
    • M militiaware

      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.)

      H Offline
      H Offline
      howardjr
      wrote on last edited by
      #2

      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();

      M 1 Reply Last reply
      0
      • H howardjr

        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();

        M Offline
        M Offline
        militiaware
        wrote on last edited by
        #3

        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.)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups