/    Sign up×
Community /Pin to ProfileBookmark

Javascript on a page based on my template

I am trying to insert the Slide Show javascript on my page; however, the page is based on my template, so I cannot insert the slide show script into the locked portion of the page (in the head tag). I don’t want a slide show on every page of my site.

So how does one get a script on a page such as this: [url]http://www.Kinann.com/ChinaInvestment/pages/photos.htm[/url]

Right now there is nothing on the page except the latin jibberish for placement. But right where that is, is where I wanted to put a slide show.

Thank you
Pamela (PJ)

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@Warren86Feb 25.2005 — You can place JS between the Body tags, as well:

<HTML>

<Head>

</Head>

<Body>

<Script Language=JavaScript>

alert('Slide show code goes here')

</Script>

</Body>

</HTML>
Copy linkTweet thisAlerts:
@pjkinannauthorFeb 25.2005 — But what do you do with the part of the script that needs to be in the head tags? if you have a template, you can't do that on individual pages???
Copy linkTweet thisAlerts:
@Warren86Feb 25.2005 — None of the script MUST be within the Head tags. The example I posted is the example. Why not just try it with the code you want to insert, rather than continuing to ask "what if?"
Copy linkTweet thisAlerts:
@pjkinannauthorFeb 25.2005 — Well, I just didn't need to screw up my page. But I guess I can just save a copy and try it there.

Just that the instructions say there are 3 steps:

1. copy the code into the HEAD OF YOUR HTML

2. copy the onLoad event into the body

3. last coding in the body

So with those instructions I figured part of this has to go into the head, and that's impossible on a template based page.

So I'll just give it a try. thanks
Copy linkTweet thisAlerts:
@Warren86Feb 25.2005 — Yes. I understand. But NONE of the code, unless it contains document.write MUST be in the Head.

And I understand that you can't save a copy of the existing template.

Why not just try the code I initally posted, with a simple alert? Just to assure yourself that it will work.

Regarding the onload...

If you already have an onload statement in the opening Body tag, then there will be a problem.

If not, then do exactly as instructed.

If there is another onload in the opening Body tag, then I would do this:

In between any Script tags that you put within the Body tags, do this:

function init(){

firstOnloadFunction();

secondOnloadFunction();

}

window.onload=init;

And this comes with the understanding that those firstOnloadFunction is not the actual name of the function, and that it should be the actual name of the function.
Copy linkTweet thisAlerts:
@pjkinannauthorFeb 25.2005 — Okay, cool. Thank you so much for your help!
Copy linkTweet thisAlerts:
@Warren86Feb 25.2005 — You're welcome. I appreciate your courtesy. Take care.

And, I did't state this, but if there is an existing onload in the opening Body tag, obviously, eliminate it, and use the above code.
Copy linkTweet thisAlerts:
@pjkinannauthorFeb 26.2005 — Thanks for the update on that!
×

Success!

Help @pjkinann spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...