problems migrating to better use of CSS

JavaScript and client side scripting.

Moderator: General Moderators

m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

<a name="#what-the-link-is-for" href="#" onClick="window.open('what-the-link-is-for.php?possible_args=dynamically_generated', 'what-the-link-is-for', 'height=some_height,width=some_width,scrollbars=yes');">what-the-link-is-for</a>

i have links all over the place that use the name tag to open a link in a new window without losing your place on the page

i never used id, but from something i saw it loks like you can add css option IN the id tag as well.. so i didn't think that it was a replacement for name
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

Well it looks like you're just setting a page anchor there. Sure, use name for that. But there's no reason not to use ID. CSS/javascript can identify any element that's properly IDed (just make sure everything is distinctly named!) and do almost anything you want to it.

ID isn't really a replacement for name. They both have their uses. ID has more uses, for me, but there's no "ID is better than NAME" or whatever, because they do different things.
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

ok. i thought name was deprecated though, which is why i want to get toknow id better
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

I don't believe it's deprecated... I think it can't be, because it's necessary for proper handling of form elements.
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

one of the pages i saw naming changes said it's replaced with id
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

Well they must know something I don't... try submitting a form with no NAME elements and see if you get any useful data out of it.
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

only time i name forms is when i use javascript in them. otherwise i have no name and there's never a problem
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

Sorry, I mean names on your input fields, not on the form itself.
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

lol.
yeah. i'm nto sure. i think it was meant in reference to the a that name was deprecated, but i agree, something sounds fishy about w3cschools calling it deprecated now that i think of it in reference to ththe inputs of a form.
Post Reply