CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   jQuery Why am I such a noob? (http://www.codingforums.com/showthread.php?t=273842)

nolvorite 09-22-2012 02:56 PM

Why am I such a noob?
 
I have no idea why this line of code isn't working--
http://vanishingpoint.b1.jcink.com/i...p?showtopic=14 (not advertising here lol)

I want to give .tableborder the id topictext for that page but it doesn't seem to be working
I can't edit the html template because it's a sad free forum host l0l

anywho this is the line of code that doesn't work
if it works the entire .tableborder shouldnt show because I had it set to display:none in my css
Code:

$("div.tableborder").hasClass("postlinksbar").attr("id","topictext");
the entire script
Code:

<script type="text/javascript">
if($("#userlinks td:contains('Welcome Guest')").length>0){
$("#userlinks td:contains('Welcome Guest')").wrapInner("<div id='lag1'></div>").html($("#userlinks td:contains('Welcome Guest')").html().replace(/Guest/, '<span class="guestbx">Guest</span>'));
}
$("div#lag1").insertBefore("#logostrip");
$("#navstrip").html($("#navstrip").html().replace(/&nbsp;/, '')).html($("#navstrip").html().replace(/Log In/, "<div id='navtext'>Login</div>"));
$("#menux a:last").attr("id","sadfix");
$("div#navstrip a:first-child").attr("id","original");
$("#menux a:last").hover(
function()
{$("div#stupidpad").css("background-image","url('http://vanishingpoint.b1.jcink.com/uploads/vanishingpoint//23125i.png')");}
,function()
{$("div#stupidpad").css("background-image","url('http://vanishingpoint.b1.jcink.com/uploads/vanishingpoint//23125g.png')");}
);
$("table").removeAttr("cellpadding").removeAttr("cellspacing").removeattr("border");
$("td.row2[nowrap]").addClass("postinfo");
$("div.tableborder").hasClass("postlinksbar").attr("id","topictext");
</script>


DanInMa 09-22-2012 03:30 PM

first of all you have an error on line 593 - you didnt capitilize the A

Code:

$("table").removeAttr("cellpadding").removeAttr("cellspacing").removeattr("border");

DanInMa 09-22-2012 03:38 PM

Code:

$("div.tableborder").hasClass("postlinksbar").attr("id","topictext");
is not working becuase this does not match your html structure.

this line basically says find the div that has a class ov tableborder and also has a class of postlinksbar.

in your html postlinksbar is inside of a div with a class of tableborder

so if you wan to set the id of that div to "topictext"

then :

Code:

$("div.tableborder > .postlinksbar").attr("id","topictext");
and your a noob becuase you are learning, don't be so hard on yourself . So please read the posting rules in regards to subject titles. " im a noob" doesnt help much ;)


All times are GMT +1. The time now is 01:15 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.