function onload

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/69956?pagenum=1
05 November 2025, 08:47

Topic


Webbo
function onload
04 July 2011, 13:11


Help smile
I need to put the following embedded code into an onload function within a forum page, and I am stuck

The embed code (edited for security reasons) is as follows:

Code:
<script language='javascript' type='text/javascript' src='http://something.com/in.php?action=adserve&method=videopage&videoPageCode=video_player_page11&boxId=editAdDiv&syndicationTargetPageID=B-7070-4FA2'></script><div id='editAdDiv'></div>


Please could someone show me how?

 

Replies ...


Davio
04 July 2011, 17:07


Why not put it in the header or footer of the forum? If you put it in the footer, the javascript will execute after the page is loaded.
Webbo
04 July 2011, 17:18


The embed code is specific to one page Davio, hence the need to include it within that page's code
leatherlips
04 July 2011, 21:09


I think you could add this to the inc_header.asp page and it would then only load for the page you wanted it on:

Code:
if request.servervariables("URL") = "/forum/yourpagehere.asp" then
%>
Content in here <%
end if
Change the parts in red for your own page and code.
Webbo
05 July 2011, 02:38


The only problems I can see with that check is it will be made everytime a page is viewed that uses inc_header.asp and we get approx 11million page views a month, also I would not have any control where the resulting output is displayed

Here is a link to the page in question, the embedded code produces the video section, you can see the lag in the page rendering

http://www.maggotdrowning.com/forum/tv_channel.asp
HuwR
05 July 2011, 06:48


that is not a forum page, we don't have any pages called tv_channel. can you post a text version of that page so we can take a look
leatherlips
05 July 2011, 10:34


Here is a thought. Since you made a special page maybe you could copy the inc_header.asp page and name it inc_header_tvchannel.asp. Add your code to it. Then in your tv_channel.asp page you could have it call inc_header_tvchannel.asp instead of the normal inc_header.asp page.
AnonJr
05 July 2011, 11:31


Originally posted by leatherlips
Here is a thought. Since you made a special page maybe you could copy the inc_header.asp page and name it inc_header_tvchannel.asp. Add your code to it. Then in your tv_channel.asp page you could have it call inc_header_tvchannel.asp instead of the normal inc_header.asp page.

The only problem with that is keeping updates synchronized between the two. If there's something that needs changing on both includes, you'll have to remember to make two sets of changes.
Not bad when you only have two sets of changes, but that mindset only leads to madness later on. Take it from someone who's maintained someone else's code designed like that...
Etymon
05 July 2011, 12:58


This should work since you are just keeping up with the <body> tag for the onload function regarding edits. You could take your current inc_header.asp file (after editing and saving it) and then do a "Save As..." to save it as inc_header_tv_channel.asp (overwriting the old inc_header_tv_channel.asp file) as long as you remember to replace the needed onload function into the <body> tag once again after that save.
Webbo
05 July 2011, 17:27


As AnonJnr said it would be a problem keeping the includes updated - there are four different tv_channel pages in total, each rendering different video content and with their own embed codes so I would need four versions of the inc_header_tvchannel.asp, not unless I could use a series of 'if's which checks the page being rendered and then loads the correct code - but that's just getting too complicated

Huwr, the page is a custom file and not an original Snitz file, a text version is available Here
© 2000-2021 Snitz™ Communications