jquery - Find and Replace -
I have a table on which I am scrap using jQuery load function, with a function text and graphics Returns the table. The images that I scrawl use relative paths for images, so when I send the code back to my page the images are not displayed. I am looking for a jQuery function to search the tag. And either updating the cancellation sites url in the src attribute, but I'm not fortunate enough.
The current tag looks like this:
What I need to do is incorporate into the source attribute, so it looks like this:
& lt; Img style = "border: thin solid black; margin-top: 5-x;" src = "http://www.somesite.com/images/picture.jpg" & gt;
each (function () {$ (this) .attr ( "Text" itemprop = "text"> $ ("table IMG") after "src", "http: //www.somesite") .com "+ $ (this) .attr (" src "));});
& lt; Script src = "path_to_jquery.js" & gt; & Lt; / Script & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ ("# table"). Load ("target_website table: nth-child (3)", function () {// info: Actually I'm not sure that inside it This function will be owed / you will see each image in #table ... $ (this). ("Img"). Every function works with {// ... and the source attribute of each Image $ (this) .attr ("src", "http://www.somesite.com" + $ (this) .attr ("src"));});});}); & Lt; / Script & gt; & Lt; Div id = "table" & gt; & Lt; / Div & gt;
Comments
Post a Comment