Snippet code placement help! urgent

pythonimp

New Member
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!
 

jnjc

New Member
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

New Member
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
 

pythonimp

New Member
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: [email protected]

Thanks again!
 
Top