Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2008

    Question jquery: script doesn't run on ajax loaded page

    i have placed the custom js script in the ajax loaded page, say park.html

    however, when i load it via .tabs(),

    the custom js script will not run.

  2. #2
    Join Date
    May 2007
    Do you see any error messages in the Javascript console? It's hard to say what the problem is given the information you've provided - there could be lots of things causing it to not function correctly. If you can post the a simple version of the HTML and Javascript code you're using, you're much more likely to get a helpful response from someone here.

  3. #3
    Join Date
    May 2008
    Brantford, Canada
    Got a link? Can't diagnose anything without seeing ALL the code.

  4. #4
    you will getting the JS error, so first you check the error console in your firebox browser..please check it and let me know..

  5. #5
    Join Date
    Aug 2001
    Orange County, CA
    You're talking about embedding a <script> block in HTML content that you're pulling directly through Ajax, right? Firefox won't evaluate those blocks if they're in Ajax-provided HTML. Some other browsers will.

    Your approach is mostly going to depend on whether the app/browser knows ahead of time what it wants to do (client-side), or whether the server can provide unexpected functionality (server-side). Most of the time I'm working with pluggable PHP apps, so 'tabs' could show up in my app for any reason from any plugin -- and I can't know ahead of time what their scripting needs are.

    If my needs are simple, I use "onclick" in the dynamic HTML, or I do the post-Ajax binding with jQuery. If my needs are complex (adding context-sensitive scripts) then I'll do something like providing the HTML and JS wrapped in a single JSON response. You can 'DIV.innerHTML' the HTML and eval() (or otherwise handle) the JS.
    Jeff Standen, Chief of R&D, WebGroup Media LLC. - LinkedIn
    Cerb is a fast and flexible web-based platform for business collaboration and automation.

Similar Threads

  1. Ajax and jQuery interaction problem
    By computerwiz3491 in forum Programming Discussion
    Replies: 3
    Last Post: 04-20-2009, 09:34 AM
  2. Ajax - list arrays by using JQuery
    By horizon in forum Programming Discussion
    Replies: 1
    Last Post: 01-25-2008, 08:23 AM
  3. Excecute javascript on ajax loaded content?
    By bannerdoers in forum Programming Discussion
    Replies: 2
    Last Post: 06-19-2007, 06:27 PM
  4. Ajax Page rank checker script for sale
    By elsonar in forum Other Offers & Requests
    Replies: 8
    Last Post: 05-27-2006, 02:21 AM
  5. AJAX loaded content, indexed able?
    By Oakii in forum Web Design and Content
    Replies: 3
    Last Post: 12-22-2005, 01:28 PM

Posting Permissions

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