This is a discussion on php and javascript error within the PHP General forums, part of the PHP Programming Forums category; I've just run into this problem this morning.... <a href="#" onclick="javascript:window.open('web_forward....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I've just run into this problem this morning....
<a href="#" onclick="javascript:window.open('web_forward.php?a ddress=<? echo $web_url; ?>&agent=<? echo $agent; ?>&real_company_name=<? echo $real_company_name; ?>', 'Web Site');"> This produces an "Error on Page" in IE 7, but works perfectly in Firefox and Netscape. I have several other javascript calls on the page where this call resides and all of them work perfectly except for this one. Does this error occur because I'm sending the variables to another script that does some logging then forwards the user to the URL or is it just a IE quirk? |
|
|||
|
2007. 03. 7, szerda keltezĂ©ssel 10.59-kor Ed Curtis ezt Ă*rta:
> I've just run into this problem this morning.... > > <a href="#" onclick="javascript:window.open('web_forward.php?a ddress=<? > echo $web_url; ?>&agent=<? echo $agent; ?>&real_company_name=<? echo > $real_company_name; ?>', 'Web Site');"> > > This produces an "Error on Page" in IE 7, but works perfectly in Firefox > and Netscape. > > I have several other javascript calls on the page where this call > resides and all of them work perfectly except for this one. Does this > error occur because I'm sending the variables to another script that > does some logging then forwards the user to the URL or is it just a IE > quirk? > I'm almost sure it has nothing to do with php rather javascript, and maybe microsoft's special javascript interpretations... greets Zoltán Németh |
|
|||
|
Open the page with IE 7, and open the source, if it doesn't show any <? or
?> tags, then it is a IE problem.. Tijnema On 3/7/07, Németh Zoltán <znemeth@alterationx.hu> wrote: > > 2007. 03. 7, szerda keltezéssel 10.59-kor Ed Curtis ezt írta: > > I've just run into this problem this morning.... > > > > <a href="#" onclick="javascript:window.open('web_forward.php?a ddress=<? > > echo $web_url; ?>&agent=<? echo $agent; ?>&real_company_name=<? echo > > $real_company_name; ?>', 'Web Site');"> > > > > This produces an "Error on Page" in IE 7, but works perfectly in Firefox > > and Netscape. > > > > I have several other javascript calls on the page where this call > > resides and all of them work perfectly except for this one. Does this > > error occur because I'm sending the variables to another script that > > does some logging then forwards the user to the URL or is it just a IE > > quirk? > > > > I'm almost sure it has nothing to do with php > rather javascript, and maybe microsoft's special javascript > interpretations... > > greets > Zoltán Németh > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > |
|
|||
|
> I've just run into this problem this morning.... > > <a href="#" onclick="javascript:window.open('web_forward.php?a ddress=<? > echo $web_url; ?>&agent=<? echo $agent; ?>&real_company_name=<? echo > $real_company_name; ?>', 'Web Site');"> > > This produces an "Error on Page" in IE 7, but works perfectly in Firefox > and Netscape. > > I have several other javascript calls on the page where this call > resides and all of them work perfectly except for this one. Does this > error occur because I'm sending the variables to another script that > does some logging then forwards the user to the URL or is it just a IE > quirk? > This is a JavaScript issue, but may have something to do with the data you are echoing out in PHP. Look at the source in the browser. My guess it that you've got a stay quote mark in one of your PHP vars. Edward PS: If you want your code to validate, change the & to & Add the closing </a> tag too. PPS: It's advisable not to use the short tags, use <?php instead of <? |
|
|||
|
Németh Zoltán wrote:
> 2007. 03. 7, szerda keltezĂ©ssel 10.59-kor Ed Curtis ezt Ă*rta: > >>I've just run into this problem this morning.... >> >><a href="#" onclick="javascript:window.open('web_forward.php?a ddress=<? >>echo $web_url; ?>&agent=<? echo $agent; ?>&real_company_name=<? echo >>$real_company_name; ?>', 'Web Site');"> >> >>This produces an "Error on Page" in IE 7, but works perfectly in Firefox >>and Netscape. >> >>I have several other javascript calls on the page where this call >>resides and all of them work perfectly except for this one. Does this >>error occur because I'm sending the variables to another script that >>does some logging then forwards the user to the URL or is it just a IE >>quirk? >> > > > I'm almost sure it has nothing to do with php > rather javascript, and maybe microsoft's special javascript > interpretations... I know it's not the PHP but rather the JS that's causing it. What I fail to understand is that there are 2 JS calls before, and 2 JS calls after this one in my page and the other 4 work perfectly. They are basically the same call too, just to different scripts. I just wondered if anyone knew why this particular call doesn't work or had come across anything like this. Thanks |
|
|||
|
On 3/7/07, Ed Curtis <e_curtis@homes2see.com> wrote:
> > Németh Zoltán wrote: > > 2007. 03. 7, szerda keltezéssel 10.59-kor Ed Curtis ezt írta: > > > >>I've just run into this problem this morning.... > >> > >><a href="#" onclick="javascript:window.open('web_forward.php?a ddress=<? > >>echo $web_url; ?>&agent=<? echo $agent; ?>&real_company_name=<? echo > >>$real_company_name; ?>', 'Web Site');"> > >> > >>This produces an "Error on Page" in IE 7, but works perfectly in Firefox > >>and Netscape. > >> > >>I have several other javascript calls on the page where this call > >>resides and all of them work perfectly except for this one. Does this > >>error occur because I'm sending the variables to another script that > >>does some logging then forwards the user to the URL or is it just a IE > >>quirk? > >> > > > > > > I'm almost sure it has nothing to do with php > > rather javascript, and maybe microsoft's special javascript > > interpretations... > > I know it's not the PHP but rather the JS that's causing it. What I fail > to understand is that there are 2 JS calls before, and 2 JS calls after > this one in my page and the other 4 work perfectly. They are basically > the same call too, just to different scripts. I just wondered if anyone > knew why this particular call doesn't work or had come across anything > like this. > > Thanks I think you're not at the right mailing list for this, and btw, it would be a lot easier to find what is going wrong, if you post one of the working ones... Tijnema -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > |
|
|||
|
>
>> I've just run into this problem this morning.... >> >> <a href="#" onclick="javascript:window.open('web_forward.php?a ddress=<? >> echo $web_url; ?>&agent=<? echo $agent; ?>&real_company_name=<? echo >> $real_company_name; ?>', 'Web Site');"> >> >> This produces an "Error on Page" in IE 7, but works perfectly in Firefox >> and Netscape. >> >> I have several other javascript calls on the page where this call >> resides and all of them work perfectly except for this one. Does this >> error occur because I'm sending the variables to another script that >> does some logging then forwards the user to the URL or is it just a IE >> quirk? >> > > This is a JavaScript issue, but may have something to do with the data you > are echoing out in PHP. Look at the source in the browser. My guess it > that > you've got a stay quote mark in one of your PHP vars. > > Edward > > PS: If you want your code to validate, change the & to & Add the > closing </a> tag too. > PPS: It's advisable not to use the short tags, use <?php instead of <? in such a cases I usually use <?= $var ?> instead <?php echo $var ?>. At least it's shorter. :) -afan > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > |
|
|||
|
>>><a href="#" onclick="javascript:window.open('web_forward.php?a ddress=<? >>>echo $web_url; ?>&agent=<? echo $agent; ?>&real_company_name=<? echo >>>$real_company_name; ?>', 'Web Site');"> >>> >>>This produces an "Error on Page" in IE 7, but works perfectly in Firefox >>>and Netscape. >>> >>>I have several other javascript calls on the page where this call >>>resides and all of them work perfectly except for this one. Does this >>>error occur because I'm sending the variables to another script that >>>does some logging then forwards the user to the URL or is it just a IE >>>quirk? >>> >> >>This is a JavaScript issue, but may have something to do with the data you >>are echoing out in PHP. Look at the source in the browser. My guess it >>that >>you've got a stay quote mark in one of your PHP vars. Not it, I looked and there's nothing there. >>PS: If you want your code to validate, change the & to & Add the >>closing </a> tag too. Thanks, the &'s are now all &. The closing </a> is in the script, just wasn't posted in the message. >>PPS: It's advisable not to use the short tags, use <?php instead of <? Can you tell me why? Is it just a personal preference? Another JS call directly in front of this one works perfectly. <a href="#" onclick="javascript:window.open('email.php?mls=<? echo $mls; ?>&toagent=<? echo $agent; ?>&toagentemail=<? echo $agent_email; ?>&tocompanyname=<? echo $real_company_name; ?>', 'Email', 'width=400,height=400,scrollbars=no,resizable=yes' );"> Send Me Email </a> The only difference is this call has the window options included the one that doesn't work doesn't have them. I've added them just to check and it didn't change anything. |
|
|||
|
> -----Original Message-----
> From: Ed Curtis [mailto:e_curtis@homes2see.com] > Sent: Wednesday, March 07, 2007 11:47 AM > To: php-general@lists.php.net > Subject: Re: [php] php and javascript error > > > >>><a href="#" onclick="javascript:window.open('web_forward.php?a ddress=<? > >>>echo $web_url; ?>&agent=<? echo $agent; ?>&real_company_name=<? echo > >>>$real_company_name; ?>', 'Web Site');"> > >>> > >>>This produces an "Error on Page" in IE 7, but works perfectly in > Firefox > >>>and Netscape. Is it because you have given the window the name 'Web Site' which contains a space character? Try naming it 'WebSite' (without the space) Hopefully that is the culprit. > >>>I have several other javascript calls on the page where this call > >>>resides and all of them work perfectly except for this one. Does this > >>>error occur because I'm sending the variables to another script that > >>>does some logging then forwards the user to the URL or is it just a IE > >>>quirk? > >>> > >> > >>This is a JavaScript issue, but may have something to do with the data > you > >>are echoing out in PHP. Look at the source in the browser. My guess it > >>that > > >>you've got a stay quote mark in one of your PHP vars. > > Not it, I looked and there's nothing there. > > >>PS: If you want your code to validate, change the & to & Add the > >>closing </a> tag too. > > Thanks, the &'s are now all &. The closing </a> is in the script, > just wasn't posted in the message. > > >>PPS: It's advisable not to use the short tags, use <?php instead of <? > > Can you tell me why? Is it just a personal preference? > > Another JS call directly in front of this one works perfectly. > > <a href="#" onclick="javascript:window.open('email.php?mls=<? echo $mls; > ?>&toagent=<? echo $agent; ?>&toagentemail=<? echo $agent_email; > ?>&tocompanyname=<? echo $real_company_name; ?>', 'Email', > 'width=400,height=400,scrollbars=no,resizable=yes' );"> > Send Me Email > </a> > > The only difference is this call has the window options included the one > that doesn't work doesn't have them. I've added them just to check and > it didn't change anything. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > |
|
|||
|
> >>><a href="#" onclick="javascript:window.open('web_forward.php?a ddress=<? > >>>echo $web_url; ?>&agent=<? echo $agent; ?>&real_company_name=<? echo > >>>$real_company_name; ?>', 'Web Site');"> > >>> > >> > >>This is a JavaScript issue, but may have something to do with > the data you > >>are echoing out in PHP. Look at the source in the browser. My guess it > >>that > > >>you've got a stay quote mark in one of your PHP vars. > > Not it, I looked and there's nothing there. I'm sure it's because you've got some stray characters in your output that mess it up. It would help if you actually posted the source rather than just saying it's OK, when it clearly isn't. > >>PPS: It's advisable not to use the short tags, use <?php instead of <? > > Can you tell me why? Is it just a personal preference? If you move to another server where the short tags option is off, your code will break. From the manual: Using short tags should be avoided when developing applications or libraries that are meant for redistribution, or deployment on PHP servers which are not under your control, because short tags may not be supported on the target server. For portable, redistributable code, be sure not to use short tags. |