Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Cowboy Nation
    Thanked 257 Times in 257 Posts

    Talking to another page

    Hey all,

    Im not to familiar with JS so this may be impossible or easy to do, but my question is i want to talk to another page from another page.

    For example i have a color picker for javascript and i am trying to take an onClick and have that certain function talk to the other page to tell it to change the color.

    how would i take for instance:

    function SendColor() {
    some code
    How would i send that to another existing page to complete that function?

    thanks in advance if this is possible!!

  • #2
    Regular Coder Actinia's Avatar
    Join Date
    Feb 2007
    Essex, UK
    Thanked 23 Times in 22 Posts
    If the second page is simply called by the first page, you can call it with the additional information appended to the called url. Thus instead of calling targetpage.htm, you can call targetpage.htm?color=#FF0000.

    The target page can then parse location.search. In this case the value of location.search would be "?color=#FF0000".

    John Rostron


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts