tags:

views:

32

answers:

1

It works

var tip = "<p>Most computers will open PDF documents automatically, but you may need to download <a title='Link to Adobe website-opens in a new window'";
tip +=" href='http://www.adobe.com/products/acrobat/readstep2.html' target='_blank'>Adobe Reader</a>.</p>";


if($("div#maincontent a[href*='.pdf']").length>0){
    $("div#maincontent").children(":last-child").after(tip);

but it not

var tip = "<p class="adobe-reader-download">Most computers will open PDF documents automatically, but you may need to download <a title='Link to Adobe website-opens in a new window'";
tip +=" href='http://www.adobe.com/products/acrobat/readstep2.html' target='_blank'>Adobe Reader</a>.</p>";


if($("div#maincontent a[href*='.pdf']").length>0){
    $("div#maincontent").children(":last-child").after(tip);
+3  A: 

You are using double quotes here at where it says adobe-reader-download

var tip = "<p class="adobe-reader-download">

Try this:

var tip = "<p class=\"adobe-reader-download\">

Note: If you use single quotes for your entire string, you won't need to escape double quotes.

Sarfraz
thanks working now. pls answer my this question also if you can http://stackoverflow.com/questions/2696321/how-to-randomly-change-inline-images-on-page-load-and-each-refresh-using-jquery
metal-gear-solid
@metal-gear-solid: Thanks..........good news.
Sarfraz
@Sarfraz - yes - both conditions working
metal-gear-solid