http://jimpix.co.uk/clients/a/ecards/defaultx.asp
Click on any of the links on the right under the 'occassions' or 'others' headings, in Firefox, and thumbnails appear based on what you clicked on.
Do the same in IE6, and it returns an error:
Line: 71
Char: 9
Error: Unknown runtime error
This relates to this line:
Expand|Select|Wrap|Line Numbers
- <p class="ctr"><span id="my_photo_id_label"></span></p>
This is the javascript on the page:
Expand|Select|Wrap|Line Numbers
- function addLoadEvent(func) {
- var oldonload = window.onload;
- if (typeof window.onload != 'function') {
- window.onload = func;
- } else {
- window.onload = function() {
- if (oldonload) {
- oldonload();
- }
- func();
- }
- }
- }
- function GetXmlHttpObject() {
- var xmlhttp;
- if (window.XMLHttpRequest) { // Mozilla, Safari, Opera...
- xmlhttp = new XMLHttpRequest();
- //if (xmlhttp.overrideMimeType) xmlhttp.overrideMimeType('text/xml');
- } else if (window.ActiveXObject) { // IE
- try {
- xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
- } catch (e) {
- try {
- xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e) {}
- }
- }
- if (!xmlhttp) {
- alert('Cannot create an XMLHTTP instance');
- return false;
- }
- return xmlhttp;
- }
- var ec = GetXmlHttpObject();
- function sendMyPhotoRequest(id) {
- ec.open('get', '../ajax/ajax-ec.asp?id=' + encodeURIComponent(id));
- ec.onreadystatechange = handleMyPhotoResponse;
- ec.send(null);
- }
- function handleMyPhotoResponse() {
- // If everything is okay:
- if(ec.readyState == 4){
- // Assign the returned value to the document object.
- document.getElementById('my_photo_id_label').innerHTML = ec.responseText;
- }
- }
- addLoadEvent(function() {
- sendMyPhotoRequest(44);
- })
Expand|Select|Wrap|Line Numbers
- <li><a href= "#pop" onclick="sendMyPhotoRequest(45);">Various</a></li>
I tested on another page:
http://jimpix.co.uk/clients/a/ecards/default-photo.asp
And this works in IE6, even though the Javascript is v. similar.
But instead of passing the variable as a number as above, the hyperlink is as follows:
Expand|Select|Wrap|Line Numbers
- <a title="" href="#pc" onclick="sendPhotoRequest(next_photo());">Next</a>
Expand|Select|Wrap|Line Numbers
- addLoadEvent(function() {
- sendPhotoRequest(MyPhotoVar);
- })
Expand|Select|Wrap|Line Numbers
- var MyPhotoVar = 0;
I'm sorry for:
1. Going on for so long
2. Not knowing what I'm doing
3. Talking a load of rubbish
Thanks