homepage Welcome to WebmasterWorld Guest from 204.236.255.69
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Rating System
charlee




msg:3666579
 11:35 am on Jun 4, 2008 (gmt 0)

Im creating a rating system for the user to rate some models of a fashion magazine. Im using AJAX for this so the user doesnt need to reload the page and can get the results right away. I have several rating sets in my page, I have 11 model pictures and behind you have the stars to rate, you just move over the stars u click it triggers a javascript page added to my header with all the code to connect to the php page and get the response and then document.getelementbyid.style = xhr.responseText.

The problem is that in my server it was working perfectly without problems in Firefox in IE7 and 6, Safari, Opera but then when i uploaded the page to the internet I dont know why the AJAX code doesnt update the element in my page with the response but still it process the php file because when i go to the database or reload the page i can see perfectly that the vote went through. Dont have idea of whats happening here.

thanks in advance

 

daveVk




msg:3666613
 12:28 pm on Jun 4, 2008 (gmt 0)

If the domain the php page is loaded from is not the same as the domain of the ajax requist, security is probably preventing javascript from updating the page.

charlee




msg:3666967
 7:18 pm on Jun 4, 2008 (gmt 0)

i just put right now the php file along with the js file and still not working

XtendScott




msg:3667085
 8:45 pm on Jun 4, 2008 (gmt 0)

It might be a cache issue with the ajax call.

Does your ajax call have a timestamp or random number in the url it is calling? this can make it so the browser see's each call as accessing a different page and won't cache it.

charlee




msg:3667130
 9:39 pm on Jun 4, 2008 (gmt 0)

No i dont, now that you say that I remembered when I first was learning ajax my professor also mentioned this and I forgot.... But first I cleaned the cache to see if this is the real problem, after cleaning it should of admit one update but it didnt work. Also I dont always pass the same get params because im talking about a page with at least 10 voting sets so everytime you click in one of these it passes different get variable values. What else might I being missing here guys? :(

daveVk




msg:3667345
 6:02 am on Jun 5, 2008 (gmt 0)

How about adding alert to see if there is a reply and what it is

alert(xhr.responseText);
document.getelementbyid.style = xhr.responseText

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved