javascript - Help with JQuery conditional statement -


i trying run jquery script on particular page if page loads.

the scenario: have 1 page loads (i.e., webpage.aspx) , loads different content based on referring click. (i.e., webpage.aspx?contentid=1, webpage.aspx?contentid=2, webpage.aspx?contentid=3, etc). here problem. need have particular part of page removed if 1 specific contentid pulled. trying in jquery , can't seem figure out.

here's have been working far. realize it's not correct gives starting point work with.

thanks.

code:

$(window).load(function() {    var $deletenewrow = $("div.col.w140 tbody:first").find("td:first").parent().remove();    if($('#dealer-info h1').indexof('ferrari') != -1) {       $deletenewrow    } }); 

what store in $deletenewrow variable isn't jquery method, method execute. want method in if statement, (note missing .text() in if statement):

$(window).load(function() {    if($('#dealer-info h1').text().indexof('ferrari') != -1) {       $("div.col.w140 tbody:first").find("td:first").parent().remove();    } }); 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -