Welcome to WebmasterWorld Guest from 54.196.244.45

Forum Moderators: open

Message Too Old, No Replies

Rating System

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

Junior Member

5+ Year Member

joined:Apr 3, 2008
posts: 57
votes: 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

12:28 pm on June 4, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 3, 2005
posts:1585
votes: 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.
7:18 pm on June 4, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:Apr 3, 2008
posts:57
votes: 0


i just put right now the php file along with the js file and still not working
8:45 pm on June 4, 2008 (gmt 0)

Full Member

10+ Year Member

joined:June 12, 2003
posts:342
votes: 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.

9:39 pm on June 4, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:Apr 3, 2008
posts:57
votes: 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? :(
6:02 am on June 5, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 3, 2005
posts:1585
votes: 0


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

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