1,105,290 Community Members

Unexpected result with loading php file with jquery

Member Avatar
oishi
Newbie Poster
2 posts since Feb 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I am trying to load php file with jquery into div. The php file contains pagination. However, when i tried it, it seems that, the jquery is not working. But, when I access it in website directly, its working. Do you have any idea how can I load the php file with the working jquery actions?

Member Avatar
JorgeM
IT Addict
6,391 posts since Dec 2011
Reputation Points: 581 [?]
Q&As Helped to Solve: 957 [?]
Skill Endorsements: 172 [?]
Moderator
Featured
Sponsor
 
0
 

Without any relevant code or a link to the site online, it is difficult for members of this forum to give guidance.

Member Avatar
oishi
Newbie Poster
2 posts since Feb 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Sorrry. Here is the link of sample of what I'm trying to load in a div element. However, jquery that paginates the contents is not working. I tried to load it using httprequest:

 ajaxrequest('phpfile.php', 'dividhere');



 function get_XmlHttp() {
     var xmlHttp = null;
     if(window.XMLHttpRequest) {        // for Forefox, IE7+, Opera, Safari, ...
         xmlHttp = new XMLHttpRequest();
     }
     else if(window.ActiveXObject) {    // for Internet Explorer 5 or 6
     xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
   }
       return xmlHttp;
  }

  // sends data to a php file, via GET, and displays the received answer
  function ajaxrequest(serverPage, tagID) {
       var request =  get_XmlHttp();
       var  url = serverPage;
       request.open("GET", url, true);// define the request
       request.send(null);// sends data
  } request.onreadystatechange = function() {               
       if (request.readyState == 4) {
            document.getElementById(tagID).innerHTML = request.responseText;
       }
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: