Click to See Complete Forum and Search --> : Stupid,Stupid,Stupid question


jiser
07-24-2003, 02:51 PM
Hi Everybody,

Iīve got a problem here called body-onload.

In this tag
<BODY OnLoad="javascript: window.open('','paypal',''); document.paypal.submit();">
has to be something inserted called

class="main" (same function as target=main)

Iīm grateful for everyone who took time to find a solution or even tried it:
Jiser

Jona
07-24-2003, 02:59 PM
Um... What is the question? <body class="main">?

[J]ona

jiser
07-24-2003, 03:00 PM
Hi,

It should be something like this <BODY OnLoad="javascript: window.open('','paypal',''); document.paypal.submit();" class='main' >

Jona
07-24-2003, 03:04 PM
Originally posted by jiser
It should be something like this <BODY OnLoad="javascript: window.open('','paypal',''); document.paypal.submit();" class='main' >

And your question is?

[J]ona

jiser
07-24-2003, 03:07 PM
How???

Forgot to say: you can tread class="main" the same as target=main.

In the beginning the function was included in a button.


<TD width="25%" align="right"><A href="javascript: window.open('','paypal',''); document.paypal.submit();"><img src="assets/images/sendorder.gif" width="168" height="85" alt="Send purchase order" border="0" align="bottom" hspace="0" vspace="0" class="main"></a></TD>

Now I want to do this in the body onload, this goes after all not without problems. It crashes or gives a blank page

Jona
07-24-2003, 03:10 PM
Uh...


<body onload="window.open('','paypal'); document.paypal.submit();" class="main">


[J]ona

jiser
07-24-2003, 03:13 PM
Doesnīt work, it gives a blank page

jiser
07-24-2003, 03:20 PM
When the browser does not recognise the part class="main", itīll automately display a blank page.

Jona
07-24-2003, 03:24 PM
Take off the class="main" part and put all of the CSS in the .main class into the body { } part of the CSS in the STYLE tags in the head of your document.

[J]ona

jiser
07-24-2003, 03:31 PM
I donīt understand, There are no style tags in the head of the document. If you want I can send the file.htm to you

Jiser

Jona
07-24-2003, 03:36 PM
Do you have a link so that I can see it online?

[J]ona

jiser
07-24-2003, 03:37 PM
Youīre right!!

www.posterland.nl/paypal.htm

jiser
07-24-2003, 03:39 PM
Youīll see a lot of errors (thatīs because itīs a shoppingcart to PayPal) But you can chose View Source

Jona
07-24-2003, 03:45 PM
You should only have one body tag, to start with. Second, when you use window.open('','paypal'); you have nothing in the first option, so it opens a new window without anything in it. Change it to something like window.open('http://paypal.com/','paypal');

[J]ona

jiser
07-24-2003, 04:06 PM
Iīve changed into below. Now it gives a third window (404)(c:/..........paypal

<body onload="window.open('','paypal'); document.paypal.submit();" class="main">

What to do?

Jona
07-24-2003, 04:12 PM
It's window.open('http://site.com/', 'paypal');

[J]ona

jiser
07-24-2003, 04:16 PM
PayPal referres to <script type="text/javascript" language="JavaScript1.2">
xmlOHeader.GrandTotal = encryptTextData(TFormatCurrencyOnly(tmpTotal, objPriCurrency));
document.write('<FORM NAME="paypal" document.write('<INPUT TYPE="hidden"
ACTION="https://www.paypal.com/cgi-bin/webscr" METHOD="POST" target="paypal">');
NAME="cmd" VALUE="_xclick">');
document.write('<INPUT TYPE="hidden" NAME="amount" value='+decryptTextData(xmlOHeader.GrandTotal)+'>');

so you donīt have to enter a address to it

Jona
07-24-2003, 04:21 PM
Take everything out of the body tag except for this:


document.paypal.submit();


And make your form tag have this: target="paypal"

[J]ona

jiser
07-24-2003, 04:27 PM
Done!

He still gives a blank page to the paypal systems. Somewhere has class="main" to be inserted.

make your form tag have this: target="paypal"

It was already in there or do I have to change something more in there?

Jona
07-24-2003, 04:35 PM
Well, your body tag only needs the line I said it needs. It should work then.

[J]ona

jiser
07-24-2003, 04:37 PM
Automately if you donīt give it a class, itīll automately use a blank page. I can make the test-website online if you prefer.

jiser
07-24-2003, 04:45 PM
Ok,

Should be online by any minute now

The address is www.posterland.nl/~support

I have to assist you because itīs a other language. Do you have MSN.

Jona
07-24-2003, 04:51 PM
See my profile.

[J]ona

jiser
07-24-2003, 05:08 PM
Canīt be done by the site online. I think itīs possible via MSN. Could you accept me in your MSN?