views:

44

answers:

1

Hello :)

Well i am currently trying to write an ajax enabled Manga reader application for onemanga using greasemonkey (more precisely js / jquery)

my problem is that i need to execute one of the inline scripts on their page to update the next page url. so what i attempted was the following:

$.get(nextPage,function(nxtHtm) // the variable nextPage already contains required url
{
  nxtImgUrl = $(nxtHtm).find(".one-page img").attr("src");   // get next image url
  $("body").append("<img id='dynamic' src='"+nxtImgUrl+"'/>");  // append next image
  $(nxtHtm).find("script:last-1").appendTo("body"); // attempt to append script to body
  alert(nextPage); // testing if script to change page url has been executed
});

Howerver that only seems to work on the image part. the script has no effect whatsoever. i also tried to do an alert($(nxtHtm).find("script:last-1").html()); and variants such as .text() or . val() the .html() returns nothing (not "null", it just alerts a blank value) and the other two return null or undefined

Does anyone have an idea of how i can append the remote script here? or alternatively capture the text in between the tags and just eval() it?

thanks ^^

A: 

search for jsonP or comet programming.

Elzo Valugi
This should be a comment, not an answer.
Matt
sometimes life give you hints, not encyclopedias. just be thankful for those
Elzo Valugi