Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 function onload
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Webbo
Average Member

United Kingdom
982 Posts

Posted - 04 July 2011 :  13:11:27  Show Profile  Visit Webbo's Homepage  Reply with Quote
Help

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:

<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?

Edited by - Webbo on 05 July 2011 02:41:33

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 04 July 2011 :  17:07:15  Show Profile  Reply with Quote
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.

Support Snitz Forums
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 04 July 2011 :  17:18:31  Show Profile  Visit Webbo's Homepage  Reply with Quote
The embed code is specific to one page Davio, hence the need to include it within that page's code
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 04 July 2011 :  21:09:45  Show Profile  Visit leatherlips's Homepage  Reply with Quote
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:

if request.servervariables("URL") = "/forum/yourpagehere.asp" then
%>
Content in here
<%
end if
Change the parts in red for your own page and code.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 04 July 2011 21:11:19
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 05 July 2011 :  02:38:05  Show Profile  Visit Webbo's Homepage  Reply with Quote
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

Edited by - Webbo on 05 July 2011 02:38:51
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20593 Posts

Posted - 05 July 2011 :  06:48:41  Show Profile  Visit HuwR's Homepage  Reply with Quote
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

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 05 July 2011 :  10:34:43  Show Profile  Visit leatherlips's Homepage  Reply with Quote
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.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 05 July 2011 :  11:31:38  Show Profile  Visit AnonJr's Homepage  Reply with Quote
quote:
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...
Go to Top of Page

Etymon
Advanced Member

United States
2391 Posts

Posted - 05 July 2011 :  12:58:53  Show Profile  Visit Etymon's Homepage  Reply with Quote
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.
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 05 July 2011 :  17:27:49  Show Profile  Visit Webbo's Homepage  Reply with Quote
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.1 seconds. Powered By: Snitz Forums 2000 Version 3.4.07