Solved

button not displaying for FF and IE

Posted on 2014-02-03
10
272 Views
Last Modified: 2016-03-24
Hi,

I'm wondering why the button that is dynamically created not displaying for FF and IE:
http://myultratrust.com/test/myultratrust/Calculation_standard03.php

In ff, the image displays for a brief moment and then disappears.

Attaching some screenshots.

I even tried this code:
$("#agree_place_order_btn").attr("src", "https://secure.myultratrust.com/images/button-3.png");

Open in new window


But if I use the Paypal's buttons it works in all 3:
https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif

The image is live:
https://secure.myultratrust.com/images/button-3.png

So why does it work in chrome and not in ff and ie?

Thanks!
ff-Screenshot-2014-02-03-16.53.2.png
ie-Screenshot-2014-02-03-16.52.4.png
chrome-Screenshot-2014-02-03-16..png
0
Comment
Question by:Victor Kimura
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39831302
Wanna give us a clue as to what button we should be looking for?
0
 

Author Comment

by:Victor Kimura
ID: 39831316
@Cathal,

Yeah, sorry.

https://secure.myultratrust.com/images/button-3.png

it was noted in the first post too. =)
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39831341
Sorry must have missed it.

I get this error.
"NetworkError: 403 Forbidden - https://secure.myultratrust.com/images/button-3.png"

Don't have time to investigate your js further, but ajax cannot work cross domain and this is probably the reason for the forbidden.  you should set the url to be dynamic to the protocol and domain used.
When setting the button have the src preset and then just use ajax to load the button.
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 

Author Comment

by:Victor Kimura
ID: 39831360
@Cathal,

But then I'm wondering why would this link work for all 3 browsers?
https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif

But this one:
https://secure.myultratrust.com/images/button-3.png

only work for Chrome?

I have this part returned in my json variable:
<input type="image" id="agree_place_order_btn" src="https://secure.myultratrust.com/images/button-3.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" style="border: 0px;">

Open in new window


The above is part of the PHP variable $RETWEBSITECODE:

$sPageVars['encrypted_pp_button'] = $RETWEBSITECODE;
$retPageVars = json_encode($sPageVars);
echo $retPageVars;

Open in new window


But if I use the paypal link's image for the src of the input image tag then it works in all 3 browsers.

Where do you see the NetworkError: 403 Forbidden? Is that in IE or FF? Where do you see that error? Can you give me a snapshot of what you see?
0
 
LVL 58

Expert Comment

by:Gary
ID: 39831372
In FF in Firebug, I will have a further investigation when I get back in an hour or so - it just struck me initially as ajax problem.
0
 

Author Comment

by:Victor Kimura
ID: 39831379
@Cathal,

Ok, thanks so much! Really appreciated your help! =)

By the way, I just took a short video shot of my IE debugger IDE and when I change from the image that's hosted on my site to the paypal image then it all of sudden displays:

http://myultratrust.com/test/paypal/api/payment-btn-not-showing.html

Thanks, Cathal.
0
 

Assisted Solution

by:Victor Kimura
Victor Kimura earned 0 total points
ID: 39831418
@Cathal,

I found and I'd forgotten that I placed some hotlinking prevention in my htaccess file so (before the fix) I could only display images coming from the subdomain but no other subdomain of myultratrust.com

Just fyi, if those want to have hotlinking for their entire domain but allow any hotlinking within your own root domain.

# ------------------------------------------------
# Stop hotlinking of images
# ------------------------------------------------
RewriteCond %{HTTP_REFERER} !^$
# RewriteCond %{HTTP_REFERER} !^https://(secure\.)?myultratrust.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^(https|http)://(.*(\.)*)?myultratrust.com/.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|js|css|png)$ - [F]

Open in new window

0
 
LVL 58

Expert Comment

by:Gary
ID: 39831490
NP, and glad my debugging efforts led you to the problem :o)
0
 
LVL 9

Expert Comment

by:Sar1973
ID: 39832049
In Javascript: document.getElementById("myButton");.style.display="inline"/"none";
0
 

Author Closing Comment

by:Victor Kimura
ID: 39843931
it was the htaccess file but thanks @Cathal because I wouldn't have guessed it without knowing the NetworkError 403 Forbidden on the image. That gave me the clue to search for it and I read on some forum post that it could be my code that prevented hotlinking. Then it just dawned on me.

Thanks and blessings<><
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Print Rhino Java Array in Javascript 1 35
Session on Html 8 39
javascript form - error when hitting enter 3 28
boostsrap 1 7
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question