Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-22-2012, 02:56 PM   PM User | #1
nolvorite
Regular Coder

 
nolvorite's Avatar
 
Join Date: Dec 2006
Posts: 170
Thanks: 7
Thanked 0 Times in 0 Posts
nolvorite is an unknown quantity at this point
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>
__________________
http://stereo.wired.x10.mx/cloud/The...loudmixsig.png
the cloud soup. opened July 15 -- like on facebok /////////////// like on twiter
nolvorite is offline   Reply With Quote
Old 09-22-2012, 03:30 PM   PM User | #2
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
first of all you have an error on line 593 - you didnt capitilize the A

Code:
$("table").removeAttr("cellpadding").removeAttr("cellspacing").removeattr("border");
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Old 09-22-2012, 03:38 PM   PM User | #3
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
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
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:12 AM.


Advertisement
Log in to turn off these ads.