Results 1 to 7 of 7

Thread: javascript in ajax

  1. #1
    Join Date
    Dec 2007
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default javascript in ajax

    I use ajax tab content. and when i add <script src=url></script> this javascript doesn't work. How make it to work javascript in ajax.
    Thanks

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Have you tried using <script type="text/javascript" src=url></script> instead?
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Dec 2007
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yes but it doesn't work. Ajax can;t load javascript

  4. #4
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    AJAX IS Javascript

    it stands for Asynchronous Javascript And XML

    http://en.wikipedia.org/wiki/AJAX

    if you cant get your script to load properly then check that your path is correct, and use some debugging methods like printing out something randomly.

  5. #5
    Join Date
    Dec 2007
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Boogyman thanks but i have firebog. All works great i have ajax spliter and it splits with ||javascript|| but i want add html counter and in there is <script src=counter.php></script> and it doesn't load in my site. How can i make it for work. My site is http://111.ge

  6. #6
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    that is the incorrect format of using a php file included with javascript

    Firebug is an add-on that enables you to check different portions of the site. AJAX is simply Javascript presented in a way that allows for communication with a script on the server. This is called "remote scripting". The term AJAX is just a word to describe what is happening, and remote scripting has been around for a while... That is the definition of AJAX.

    i want add html counter and in there is <script src=counter.php></script> and it doesn't load in my site
    I am going to assume by what you mean by that is you would like to use the server-side "hit" counter at that address.

    You have a couple of things you need to fix with your code. First is that you need to add the type attribute as rangana described.. this tells the browser that the "text" within is actually computer code and to use the client-side javascript language to interpret and process the code.
    The second bit of info is that it is good coding practice to encapsulate your attributes in quotes, as seen below
    Code:
    <script type="text/javascript" src="/path/to/script.js"></script>
    now to actually use AJAX to grab the hit counter information you need to read about how to interact with the server using Javascript... aka AJAX.

    for starters, check out the tutorial here done by tech_support http://dynamicdrive.com/forums/showthread.php?t=19247

  7. #7
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    If you want to include a script element why don't you use the DOM based method i.e adding a script element in to the head element of your page.

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
  •