I have been trying to solve this but can’t get it to work.
http://tinyurl.com/973he2p
**the html is supposed to go into another page so I don’t have access to html, body header tags.
The content is on the right side under the heading “You May Also Like”, and that content loads from this file
http://tinyurl.com/8rv36dl
But I have seen and it fails to load 3 out of 10 times. So I refreshed it and that really happens.
What could be the reason?
What am I doing wrong or what should I be doing to fix it? conflicts? time outs? I have tried it all.
hope to have an answer.
The apostrophe in
men's stainless steel bracelet(or whatever is inserted by the server) closes the string opened byvar content= ' ...inshowitem.jsand causes a syntax error.You need to properly escape the content generated by the server before including it in the generated javascript.
The best way, however, would be to have a static javascript file, untouched by PHP, and let it fetch its contents via AJAX. Since you are already using jQuery, read up on
$.get