Demos put linked style sheets into the body

2 views
Skip to first unread message

Klaus Hartl

unread,
Nov 9, 2007, 4:26:19 AM11/9/07
to jQuery Documents
All,

is there are a way to have the demos with the link elements in the
head instead of the body? I really, really think we shouldn't be doing
that. It's not proper HTML, bad practice and people start copying it
the way it is, which in the long run will cause more problems I
assume.


--Klaus

David Serduke

unread,
Nov 11, 2007, 11:48:57 PM11/11/07
to jQuery Documents
Which demos are you referring to? I don't think I saw any demos like
that in the core wiki demos.

David

Klaus Hartl

unread,
Nov 13, 2007, 5:23:54 AM11/13/07
to jQuery Documents
On Nov 12, 5:48 am, David Serduke <davidserd...@gmail.com> wrote:
> Which demos are you referring to? I don't think I saw any demos like
> that in the core wiki demos.
>
> David

Whenever you add an example to the documentation like:

{{APIExample|
...
|html=<nowiki><link rel="stylesheet" href="http://dev.jquery.com/view/
trunk/themes/flora/flora.all.css" type="text/css" media="screen"
title="Flora (Default)">
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/
plugins/ui/ui.tabs.js"></script>
...
}}

it ends up like this. You can even see the resulting HTML source in
the "View Source" tab of such an example. See the tabs documenntation
for example: http://docs.jquery.com/UI/Tabs


--Klaus

David Serduke

unread,
Nov 13, 2007, 3:55:48 PM11/13/07
to jQuery Documents
I went ahead and added a new variable to the APIExample template
called "inhead" which allows that to be put in the <head>. So it can
be:

{{APIExample|
...
|inhead=<nowiki><link rel="stylesheet" href="http://dev.jquery.com/


view/
trunk/themes/flora/flora.all.css" type="text/css" media="screen"
title="Flora (Default)">
<script type="text/javascript" src="http://dev.jquery.com/view/
trunk/
plugins/ui/ui.tabs.js"></script>

|html=<nowiki><div>
...
}}

Then I tested it by updating the example http://docs.jquery.com/UI/Tabs
and it appears to work.

If someone knows why that shouldn't be done (John?) I can easily back
out my changes.

David

David Serduke

unread,
Nov 13, 2007, 3:57:20 PM11/13/07
to jQuery Documents
Ack I forgot the </nowiki> at the end of the |inhead so here is the
example again:

{{APIExample|
...
|inhead=<nowiki><link rel="stylesheet" href="http://dev.jquery.com/
view/
trunk/themes/flora/flora.all.css" type="text/css" media="screen"
title="Flora (Default)">
<script type="text/javascript" src="http://dev.jquery.com/view/
trunk/

plugins/ui/ui.tabs.js"></script></nowiki>
|html=<nowiki><div>
...
}}

David

On Nov 13, 12:55 pm, David Serduke <davidserd...@gmail.com> wrote:
> I went ahead and added a new variable to the APIExample template
> called "inhead" which allows that to be put in the <head>. So it can
> be:
>
> {{APIExample|
> ...
> |inhead=<nowiki><link rel="stylesheet" href="http://dev.jquery.com/
> view/
> trunk/themes/flora/flora.all.css" type="text/css" media="screen"
> title="Flora (Default)">
> <script type="text/javascript" src="http://dev.jquery.com/view/
> trunk/
> plugins/ui/ui.tabs.js"></script>
> |html=<nowiki><div>
> ...
>
> }}
>

> Then I tested it by updating the examplehttp://docs.jquery.com/UI/Tabs


> and it appears to work.
>
> If someone knows why that shouldn't be done (John?) I can easily back
> out my changes.
>
> David
>
> On Nov 13, 2:23 am, Klaus Hartl <klaus.ha...@googlemail.com> wrote:
>
>
>
> > On Nov 12, 5:48 am, David Serduke <davidserd...@gmail.com> wrote:
>
> > > Which demos are you referring to? I don't think I saw any demos like
> > > that in the core wiki demos.
>
> > > David
>
> > Whenever you add an example to the documentation like:
>
> > {{APIExample|
> > ...
> > |html=<nowiki><link rel="stylesheet" href="http://dev.jquery.com/view/
> > trunk/themes/flora/flora.all.css" type="text/css" media="screen"
> > title="Flora (Default)">
> > <script type="text/javascript" src="http://dev.jquery.com/view/trunk/
> > plugins/ui/ui.tabs.js"></script>
> > ...
>
> > }}
>
> > it ends up like this. You can even see the resulting HTML source in
> > the "View Source" tab of such an example. See the tabs documenntation
> > for example:http://docs.jquery.com/UI/Tabs
>

> > --Klaus- Hide quoted text -
>
> - Show quoted text -

Klaus Hartl

unread,
Nov 13, 2007, 4:09:17 PM11/13/07
to jQuery Documents
On Nov 13, 9:55 pm, David Serduke <davidserd...@gmail.com> wrote:
> I went ahead and added a new variable to the APIExample template
> called "inhead" which allows that to be put in the <head>. So it can
> be:
>
> {{APIExample|
> ...
> |inhead=<nowiki><link rel="stylesheet" href="http://dev.jquery.com/
> view/
> trunk/themes/flora/flora.all.css" type="text/css" media="screen"
> title="Flora (Default)">
> <script type="text/javascript" src="http://dev.jquery.com/view/
> trunk/
> plugins/ui/ui.tabs.js"></script>
> |html=<nowiki><div>
> ...
>
> }}
>
> Then I tested it by updating the examplehttp://docs.jquery.com/UI/Tabs

> and it appears to work.

Thank you David, very nice (and fast)!

--Klaus

Reply all
Reply to author
Forward
0 new messages