Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2010
    Posts
    24
    Thanks
    13
    Thanked 0 Times in 0 Posts

    javascript "location.replace" not working in IE

    Hi all,

    In Salesforce I have a custom "Send an Email" button that uses a location.replace javascript function.

    Its not working in Internet Explorer 8 and returns the error:

    "A problem with the online Javascript for this button or link was encountered.
    Object doesn’t support this property or method."

    It is, however, working in Firefox.

    The code for the button is:

    Code:
    location.replace('/email/author/emailauthor.jsp?retURL=/{!Opportunity.Id}&p3_lkid={!Opportunity.Id}&rtype=003&p2_lkid={!Account.Id}&p4=sales@pioneer1.com&template_id=00XA0000000ebqS&p5=');

    Anyone know whats going on?

    Thanks!

  • #2
    Regular Coder
    Join Date
    Mar 2006
    Posts
    726
    Thanks
    35
    Thanked 132 Times in 123 Posts
    Can you open the page directly in IE8, by putting the url in the address bar?

    location.replace works fine in IE, but not if the page you are loading has an error, (which may not be an error outside of IE)

  • #3
    New Coder
    Join Date
    May 2010
    Posts
    24
    Thanks
    13
    Thanked 0 Times in 0 Posts
    Sorry I was so slow in getting back to you, hope I haven't lost the opportunity for help!

    Yes, copying and pasting the URL works in IE. The page loads fine when pasting, but error seen when hitting the button.

    (I got the URL from the successful instance in Firefox.)

    Thanks,

    Jeremy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •