Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Java Script Help Please

Options
  • 26-05-2004 9:27pm
    #1
    Registered Users Posts: 575 ✭✭✭


    Hi all

    I have this

    <!-- <script type="text/javascript" src="http://www.weatherzone.com.au/woys/graphic_current.jsp?postcode=3676&locality=WANGARATTA"></script>--&gt; thats runs a nice weather app on my site

    But what i was wondering was it possible to insert another java script into this java script so that each time my web page loads it changes

    postcode=3676

    to different numbers such as 2000 , 2003 , 2010 , 2390 etc

    and

    locality=Wangartta

    to Sydney , Melbourne , Darwin etc



    Is it possible to have a javascript or some script inside another ?

    regards

    al


Comments

  • Closed Accounts Posts: 102 ✭✭Something


    yes.. and no.. you could achieve that effect by running a javascript outside of that script....

    you could use something like this....
    <script language="JavaScript">
        // some code here to choose the post code
        // into an variable called "postcode" ...
    
        document.write(
            "<script type=\"text/javascript\" +
            " src=\"http://www.weatherzone.com.au/woys/graphic_current.jsp?postcode=" +
            postcode +
            "&locality=WANGARATTA\"></script>";
    </script>
    
    You'll need to write you're own code to choose the postcode because I’m not sure how exactly you want to distinguish between the pages, but this should do the trick. Have fun.


Advertisement