Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Cool parsing javascript inside AJAX call

    Hello,

    I'm trying to open a new window using javascript in a page loaded through an AJAX call. I know this is tricky using escape() or eval(), but can't get it to work. The purpose is to have a page reload in the background to dynamically check for a change in the database, and if found, open a new browser window. It works with a link, but I need it to run by itself and <body onLoad> doesn't work in the innerHTML?


    On parent page calling child using AJAX I have this:

    function openWindow() {

    window.open('http://www.google.com', 'checker', 'width=100px, height=100px, left=100px, top=100px');

    }

    inside the AJAX called page we have this:

    <a href="##" onclick="openWindow()">click me</a>

    Please Alien51, I know your out there. Please help
    Ja-Lev

  • #2
    Regular Coder
    Join Date
    Mar 2006
    Posts
    725
    Thanks
    35
    Thanked 132 Times in 123 Posts
    I hope you thanked Alien, if he has helped you.

    Your code may work from a link because the browser allows a new window to be created as the target of a link, but not as a purely scripted event.


  •  

    Posting Permissions

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