SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Location
    Baia Blu (La Spezia) - Italy
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Load xml data stored into an asp application using javascript

    Hi,
    I have an application in asp that contain xml tags, something like this:
    Code:
    application("myApp") = "<myList><user>Alethesnake</user><user>pippo</user></myList>"
    Using loadXML and xmldom or msxml I can show them without problems.

    My problem is that if the data stored into the application change I see these changes only after a reload of the page.
    With the function setinterval (that reload only the function I use to show data) and an external xml file I'm able to show changes in real time (after the interval, obviously) without the reload of the entire page. In your opinion is it possible with the data stored in the asp application?

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Location
    Baia Blu (La Spezia) - Italy
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    up

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Location
    Baia Blu (La Spezia) - Italy
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    up v.1.1

  4. #4
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    alternatively, you can use a js method I described here
    http://www.sitepointforums.com/showthread.php?t=145570

    instead of
    Quote Originally Posted by alethesnake
    "<myList><user>Alethesnake</user><user>pippo</user></myList>"
    you could store them in an external js called myList in the form
    Code:
    user[0]="Alethesnake";
    user[1]="pippo";
    you can also add variables to the names if you wish
    Code:
    \\reminder : variables in form "name,age,sex"
    user[0]="Alethesnake,26,m"
    user[1]="pippo,24,f"
    then no translation is needed.

    oops, just noticed it was a reply to your post. Still, a reminder never hurts

    ps:Any changes made to the files can be detected without reloading page.
    pps: I've noticed that offline ( local server ) IE will not detect change the rest will, but put it online and all browsers (sorry, IE6,NS7,mozilla,opera dont know of rest) detect change!!!
    Last edited by Markdidj; Jan 7, 2004 at 18:57.
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  5. #5
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I've made a mistake.
    Just checked the script, and IE is still reading from cache.
    When I tried previously I opened another window to the same page, which change the cached js, which triggered the detectLoad in the original window.

    The new variable is picked up by all but IE, and only IE needs a page refresh or a reload of the js in another window/popup
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  6. #6
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Is anyone interested in trying this out and helping me test it in different browsers?
    http://www.unitingrhythms.co.uk/forums/guestbook/

    I use the script just to check if a new message has been received.

    I'll be awake for another half hour
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  7. #7
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    No takers? Well, I tested it as much as I could.
    I opened all browsers and typed input in each one at a time.

    To change to a different script ( script1.js to script2.js ) works in IE6, NS7 and Mozilla, but still not sure of Opera.

    To reload a changed js works well in NS7 and Mozilla, but not in IE (uses cache, and no-cache pragma doesn't help). Opera unsure about.

    In Opera I have other errors and not sure if they are conflicting.

    Well, it's been another allnighter, I'm off....... Night all....
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  8. #8
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Location
    Baia Blu (La Spezia) - Italy
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi and thanks for your answer.
    a simple way I found to solve my problem is to create a page with a simple response.write of the application and catch its data by using xmlhttp.
    your solution is a good one but my scripts work firstly server-side with asp and in asp it easier reading data with loadxml than with fileSystemObject

    Bye


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
  •