Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Likely Javascript error only in internet explorer

Status
Not open for further replies.

the44chris

Programmer
Aug 6, 2007
5
US
We are having an odd problem only in internet explorer. An error exists on our product pages that is disabling the "add items to portfolio" feature. In firefox this problem does not exist. The error generated is:

Line: 42
Char: 5
Error: Object doesn’t support this property or method
Code: 0
URL: points to our order_page.pl with a reference to the specific product


I was hoping somebody could take a look over this small bit of javascript code and see if they can find anything that would cause this type of error.

Code:
[b]Add to favorites button on template:[/b]

                <a href="#" id="addToFavorites" rel="<!-- #photo_id -->">

                                                <img src="/images/add.gif" border="0">

 

 

[b]Referring JavaScript:[/b]

function initItemPage() {

                window.addEvent('domready', function(e) {

                                                printTable();

                                                $('addToFavorites').addEvent('click', function(e) {

                                                                var ev = new Event(e);

                                                                ev.stop();

 

                                                                var photoID = ev.target.getParent().getProperty('rel');

                                                                var urlPrefix = "/cgi-bin/show_favorites.pl?";

                                                                var sizeSelect = null;

 

                                                                $ES('.sizeRadioSelect').each(function(el) {

                                                                                if (el.getValue()) {

                                                                                                sizeSelect = el.getProperty('rel');

                                                                                }

                                                                });

                                                                var urlParams = new Hash();

                                                                urlParams.set('action', 'add');

                                                                urlParams.set('photo_id', photoID);

                                                                urlParams.set('size', sizeSelect);

 

                                                                var queryString = Object.toQueryString(urlParams.obj);

                                                                var resultUrl = urlPrefix + queryString;

                                                                window.location = resultUrl;

                                                });

                });

}

Thanks in advance for any help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top