limitphp Posted February 3, 2009 Share Posted February 3, 2009 I'm using the ajax function that was in the tutorial on this site. When I click on the ajax link from a pagination page that has been mod rewritten, like: http://localhost/page2/ http://localhost/page3/ etc... it messes up my ajax link. I think this is the line in the ajax function particularly that needs to be modified: MyHttpRequest.open("get", url_encode(file + query_string), true); file in this case is the php page...like vote.php only it thinks its http://localhost/page2/vote.php is there a way to modify this to make javascript get it right? like this: http://localhost/vote.php thanks on edit: here is where I put the link in my index page: <A HREF="javascript: MyAjaxRequest('voteCount<?php echo $greckle_vote_count?>','voteMessage<?php echo $greckle_vote_count?>','vote.php?songID=<?php echo $recordVote[songID]."&artistID=".$recordVote[artistID]?>')" CLASS="greckle-vote">vote</A> maybe I could change the bolded part and pass the entire domain address....? Quote Link to comment Share on other sites More sharing options...
corbin Posted February 4, 2009 Share Posted February 4, 2009 Add / to the front? '/vote.php?....... Quote Link to comment Share on other sites More sharing options...
limitphp Posted February 4, 2009 Author Share Posted February 4, 2009 Add / to the front? '/vote.php?....... Unfortunately that didn't work. I tried putting in the whole siteurl: http://localhost/vote.php but that gave me a "Forbidden You don't have permission to access /http://localhost/vote.php on this server." error. So, basically, right now, MyHttpRequest.open is probably trying to send the url request to localhost/page2/vote.php maybe I'm overlooking something here.... Quote Link to comment Share on other sites More sharing options...
limitphp Posted February 4, 2009 Author Share Posted February 4, 2009 ajax was working fine...it was a different problem....sorry... thanks guys. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.