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 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2008
    Posts
    446
    Thanks
    23
    Thanked 5 Times in 5 Posts

    ajax function undefined

    I am writing an ajax function and while I followed the w3 tutorial I am getting an undefined error. I have already checked the file path and it is good, so the external file for the ajax function is good.

    The function in question is gallerySelect()

    Here is the file to it:

    http://paperlesswasp.com/gallery/ext...jax_gallery.js

    and the method at which I am calling it is:

    Code:
    <a href="#" ><img src="/gallery/thumbs/holga.png" style="opacity: 0.6; height: 120px; width: 120px;" class="gradualshine" 
     onmouseover="slowhigh(this)" 
     onmouseout="slowlow(this)" onclick="gallerySelect(1)" alt="holga"/></a>

    I appreciate the help

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    <script type="text/javascript">

    ...........
    </script>

    <div id="myDiv"><h2>Let AJAX change this text</h2></div>
    <button type="button" onclick="loadXMLDoc()">Change Content</button>
    You shouldn't put the script tags or any html tags inside your external javascript file. The same rule applies to external CSS files also.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder
    Join Date
    May 2008
    Posts
    446
    Thanks
    23
    Thanked 5 Times in 5 Posts
    Thanks for the reply, I cant believe I forgot to take that part out.

    Also I took a look at console and remembered another error in code:

    Code:
    if (window.XMLHttpRequest)
    says its a syntax error. I didnt change it from what w3 put it as. Its on line 9 at the very beginning of the gallerySelect() function

    Any thoughts?


  •  

    Posting Permissions

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