Web Design Forum  
 
Go Back   Web Design Forum > Web Software > Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 03-04-2009, 08:31 PM   #1
New Member
 
Join Date: Mar 2009
Posts: 3
Exclamation Snippet code placement help! urgent

Ok so this problem i'm having is a show stopper, I have a website built through website tonight, which some of you may be familiar with, and know that you can't access the raw code.

Well, I bought into an affiliate script "Affiliate Script Pro"
Which has been uploaded on http://jumboviews.net

Then the actual site i'm letting affiliates market is
http://jumboviews.com

The site have have to add this code to is hxxp://jumboviews*com
So, with website tonight, I can't edit the raw code, and here is the code the affiliate script provided me with to integrate paypal with them:
Code:
<script type="text/javascript" src="http://jumboviews.net/templates/js/globals.php"></script>
<script type="text/javascript" src="http://jumboviews.net/templates/js/afpro_cookie.js"></script>
<script type="text/javascript" src="http://jumboviews.net/templates/js/afpro_trackingform.js"></script>
That snippet above has to be in the <head> section of the site on every page, which was not a problem

the second snippet of code looks like this below
Code:
<body onload="afproDocumentLoad();">
The problem with that again, is I cannot edit the raw code of website tonight.. So how can I edit that code to fit into the body somewhere and still function properly?

And of course the 3rd step for setting up integration is setting up an IPN with Paypal, the URL looks like this
Code:
http://jumboviews.net/callbacks/callback_paypal_ipn.php
Where it says "Jumboviews.net" in all of the code above, and in the URL, is that correct? Should I have the URL that my affiliate script is hosted on? Or should it be on the .com domain?

I'm really stuck guys, I would greatly, GREATLY appreciate your help!

Thanks!


P.S. if I was not clear on what's wrong, please inform me, so you can better help my situation!

This problem is a show stopper for my business! All help is GREATLY appreciated!
pythonimp is offline   Reply With Quote


Old 03-04-2009, 10:26 PM   #2
Super Moderator
 
jnjc's Avatar
 
Join Date: Jun 2008
Posts: 493
Default

To execute the afproDocumentLoad() function use something like Mootools DomReady:

http://mootools.net/docs/Utilities/DomReady

Include the Mootools Scripts at the top of your page and then use something along the lines of the following to execute the function:

Code:
window.addEvent('domready', function() {
    afproDocumentLoad();
});
HTH,
JC
jnjc is offline   Reply With Quote
Old 03-04-2009, 10:29 PM   #3
New Member
 
Join Date: Mar 2009
Posts: 3
Default

Quote:
Originally Posted by jnjc View Post
To execute the afproDocumentLoad() function use something like Mootools DomReady:

http://mootools.net/docs/Utilities/DomReady

Include the Mootools Scripts at the top of your page and then use something along the lines of the following to execute the function:

Code:
window.addEvent('domready', function() {
    afproDocumentLoad();
});
HTH,
JC
im kind of confused still..

Can you be alittle more detailed plz?
pythonimp is offline   Reply With Quote
Old 03-05-2009, 12:19 AM   #4
Super Moderator
 
jnjc's Avatar
 
Join Date: Jun 2008
Posts: 493
Default

The line

Code:
<body onload="afproDocumentLoad();">
Is executing the function afproDocumentLoad() when the body of the pages loads.

You cannot modify your body tag so you need an alternative method to execute the function. You could just include the following in the top of you page:

Code:
<script type="text/javascript">
afproDocumentLoad();
</script>
I have no idea what the functions does so it might work, but if this functions requires elements of the page to be rendered before it is executed then it might not work. If you use the method I have mentioned in my first post as follows:

Code:
<script type="text/javascript">
window.addEvent('domready', function() {
    afproDocumentLoad();
});
</script>
It means that the function will not be executed until the page has finished loading (ie the DOM is ready) and will be a closer alternative to having the code in the body tag.

Don't forget you will need to include the mootools.js on your page also.

HTH,
JC
jnjc is offline   Reply With Quote
Old 03-05-2009, 12:37 AM   #5
New Member
 
Join Date: Mar 2009
Posts: 3
Default

Quote:
Originally Posted by jnjc View Post
The line

Code:
<body onload="afproDocumentLoad();">
Is executing the function afproDocumentLoad() when the body of the pages loads.

You cannot modify your body tag so you need an alternative method to execute the function. You could just include the following in the top of you page:

Code:
<script type="text/javascript">
afproDocumentLoad();
</script>
I have no idea what the functions does so it might work, but if this functions requires elements of the page to be rendered before it is executed then it might not work. If you use the method I have mentioned in my first post as follows:

Code:
<script type="text/javascript">
window.addEvent('domready', function() {
    afproDocumentLoad();
});
</script>
It means that the function will not be executed until the page has finished loading (ie the DOM is ready) and will be a closer alternative to having the code in the body tag.

Don't forget you will need to include the mootools.js on your page also.

HTH,
JC
Thank you very much, I will give that a shot!

Do you have Skype, AIM, or MSN?
If you do add me on any of the following
Skype: JumboViews
Aim: FarmerFtw
MSN: johnboat11@hotmail.com

Thanks again!
pythonimp is offline   Reply With Quote


Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:13 AM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.