Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Rating System



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

5+ Year Member

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 Jun 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

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 Jun 4, 2008 (gmt 0)

5+ Year Member

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


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

10+ Year Member

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 Jun 4, 2008 (gmt 0)

5+ Year Member

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 Jun 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

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

document.getelementbyid.style = xhr.responseText


Featured Threads

Hot Threads This Week

Hot Threads This Month