Results 1 to 4 of 4

Thread: Calling javascript on different page

  1. #1
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Calling javascript on different page

    How can i call javascript function on page from link on different page?

    Tnx

  2. #2
    Join Date
    Jan 2007
    Posts
    51
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Default

    From what I understand, the function you want to call needs to be a child (spawned from the page with the function on it) of the calling page.

    Then I think you do: parent.functionName();

  3. #3
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    you could try cutting and pasting all of your functions and variables into one external .js file, and adding <script src="filename.js"></script> into the head of every page, that way you can access any script on your whole website on every page

  4. #4
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Sorry i did not explained very well what i want to do.

    For example, i have page1 i page2.php. On the 2nd page i have div container which i use for loading external pages by calling a simple function javascriptage(3) . In this case this function loads some 3rd page.

    When i click on some link on page1.php i want to open page2.php with loaded 3rd page into div container.

    That is my problem.How can i call function on page2.php from simple link on page1.php. Btw function is in external .js file.

    Tnx again

Bookmarks

Posting Permissions

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