JuSchz
JuSchz

Reputation: 1198

Editing head section with YUI

I want to edit the head section of my page, using YUI 3. The code below works for the body section but not for head :

Y.one("#mysection").set('href',new_url);

and my head part :

<link type="text/css" href="old_url" id="mysection" />

Is Yui able to do this ?

Upvotes: 0

Views: 55

Answers (2)

Luke
Luke

Reputation: 2581

Yep. See this gist for a working example: https://gist.github.com/2024517

Upvotes: 1

Sean
Sean

Reputation: 6499

Change the YUI code to:

Y.one("#mysection").set('href','new_url');

That seems to get it working, not quite sure why the marks are also needed around 'new_url' I guess that's just something that needs remembering.

Also, if you haven't already seen it, I find:

http://www.jsrosettastone.com/

To be particularly useful when coding YUI, it has everything you really need in one place with pretty decent explanations, it's ever more useful if you already know jQuery

Upvotes: 0

Related Questions