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....? Link to comment https://forums.phpfreaks.com/topic/143680-solved-mod-rewrite-messing-up-my-ajax-link/ Share on other sites More sharing options...
corbin Posted February 4, 2009 Share Posted February 4, 2009 Add / to the front? '/vote.php?....... Link to comment https://forums.phpfreaks.com/topic/143680-solved-mod-rewrite-messing-up-my-ajax-link/#findComment-754057 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.... Link to comment https://forums.phpfreaks.com/topic/143680-solved-mod-rewrite-messing-up-my-ajax-link/#findComment-754313 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. Link to comment https://forums.phpfreaks.com/topic/143680-solved-mod-rewrite-messing-up-my-ajax-link/#findComment-754429 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.