function onload - نوشته شده در (1086 Views)
Average Member
Webbo
مطلب: 982
982
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?
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Development Team Member
Davio
مطلب: 12217
12217
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.
نوشته شده در
Average Member
Webbo
مطلب: 982
982
The embed code is specific to one page Davio, hence the need to include it within that page's code
نوشته شده در
Senior Member
leatherlips
مطلب: 1838
1838
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.
نوشته شده در
Average Member
Webbo
مطلب: 982
982
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
نوشته شده در
Forum Admin
HuwR
مطلب: 20611
20611
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
نوشته شده در
Senior Member
leatherlips
مطلب: 1838
1838
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.
نوشته شده در
Forum Moderator
AnonJr
مطلب: 5768
5768
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...
نوشته شده در
Advanced Member
Etymon
مطلب: 2396
2396
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.
نوشته شده در
Average Member
Webbo
مطلب: 982
982
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
 
شما باید یک متن وارد کنید