jquery - adding php response with ajax -


i getting text php file using ajax so:

var oreq = new xmlhttprequest(); //new request object   oreq.onload = function() {        console.log(this.responsetext);        $('#twitterfeed').append(this.responsetext);   };   oreq.open("get", "library/twitter.php", true);   //                                  oreq.send(); 

and works fine, adding text div set in html file. issue using jticker scroll text when load text via ajax wont scroll. if paste text in div manually will. suspect since text being loaded in, jticker.js not appending necessary classes div make scroll.

you need call jticker on element every time contents change because re-measures element when call $('.ticker').jticker();

example:

var oreq = new xmlhttprequest(); //new request object oreq.onload = function() {      console.log(this.responsetext);      $('#twitterfeed').append(this.responsetext);      // add this:     $('.ticker').jticker();  }; oreq.open("get", "library/twitter.php", true); //                                oreq.send(); 

Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -