Page not loading in IE - javascript

I just made some CSS changes to a page and all works perfect in firefox safari, chrome but when i view it in IE there is nothing. I mean just a blank page
http://posnation.com/pos_support/aldelo_training_dvd
Also this is a miva site

try validating your html. You also don't have an end title tag.

Close title tag.

It looks like the tag in the page head isn't closed properly (line 4). FF and Chrome often fix this sort of error for you as they render the page, IE isn't on this occasion.

Related

Style="display:block;" works in Chrome but not Safari

I have a banner on my website that by default is not shown. The code I am using to get it to show is
document.getElementById("cookie1").style = "display:block;"
This works in Chrome but is not working in safari. I am not getting any errors in Safari either, It just doesn't show the banner.
Any ideas on what could be causing this? Or a better way to hide/show a page element?
Thanks!
From testing this in Chrome and Safari, it seems Chrome is more forgiving in that it parses the style string and puts the right style in place for you, but Safari does not.
Try:
document.getElementById("cookie1").style.display = 'block';
It's probably best to be explicit like that anyway, instead of relying on string parsing for the style itself.

fullPage js scrolls wrong height in IE

I am developing a website with fullPage js to create a scrolling site.
The scrolling works fine in Chrome and Firefox but in Internet Explorer it is completely off.
The scroll goes in between pages and to the wrong pages and you can't use the site much at all. I don't know why this is happening.
www.mpaccione.com/correlation-one/index.html
In the fullpage.js documentation you can read the following:
Be careful! data-anchor tags can not have the same value as any ID element on the site (or NAME element for IE).
Looking your resulting HTML code I can see how you use the anchor Employers and the id employers:
<div id='employers' class='howWorks grayBg'></div>
IE might not be case sensitive.

Setting content of iframe using javascript fails in firefox

I'm trying to set the content of a iframe using javascript.
I've the html string. And I'm writing:-
var iframe = $('iframe')[0],
content = '<div>test</div>';
$(iframe).contents().find('html').html(content);
It works fine in google chrome, but in firefox is shows the content for a moment and the disappears.
Please help me to fix it.
I faced the same problem. I saw the load function of iframe fires in firefox but not in chrome. So firefox reload the iframe again on load event.
So with your existing code try this:-
$(iframe).load(function(e){
$(iframe).contents().find('html').html(content);
})

Why wont this js code work in Chrome and Safari?

I have an iframe on my index.html and this iframe is dynamic.
on my index.html I have a form, which when submitted, shows the results inside the iframe.
The problem is the Iframes height also has to be dynamic for the website to look "clean".
So in the Iframes php page, I have this code:
<body onload="parent.resize_iframe(document.body.scrollHeight)">
And in the index.html (which is the parent in this case) I have this function:
function resize_iframe(new_height){
byId('iframe001').style.height=parseInt(new_height) + 20 + 'px';
}
The problem here is not the function, but that Safari and Chrome thinks the scrollHeight is something alot bigger than it is.
I have tried alerting the scrollHeight, and the nr is always around 2000px in Chrome and Safari, but in other browsers it is dynamic as it should be (500, 300, 800 etc)...
Any ideas?
UPDATE:
I noticed when I click a link on the index, and then click the browser back button, the iframe DOES resize correctly in SAFARI and CHROME.
But I must click back in the browser for it to work...
SEE THIS QUESTION FOR FURTHER INFORMATION: Can't figure out why Chrome/Safari can't get the ScrollHeight right here
I am not sure but however I want to say what I want say. Safari and Chrome both webkit based browsers so its normal to behaviour like that. So I guess that they calculating the height adding padding and margin to normal height. please google it "webkit calculated style"
Sometimes javascript does not work as expected when the page has validation errors.
First try validating your markup (HTML).
If validating does not work, try using jQuery.
jQuery is cross-browser compatible; you should get the exact same result on every browser.

Bookmarklet In New Window

So I've got a bookmarklet which should open up a page in a new window.
javascript:window.open('http://timetableapp.com/TimeTable/bookmarklet/index.html','TimeTable%20Timer','status=no,directories=no,location=no,resizable=no,menubar=no,width=400,height=210,toolbar=no');
The code works perfectly in Safari, Firefox, and Chrome; but as expected IE (7 and 8) is causing problems. IE gives me a useless error when I open the bookmarklet, and no window opens.
I've tried to editing the bookmarklet so that it appends the page with a script tag. Then inside the script tag the window.open() code is added, or it accesses the script (which contains the window.open() ) [I've tried it both ways]
I'm at a loss now.
Anyone have any idea how to get the page to popup in IE (preferably with code that works in Safari, FF, and Chrome too)?
Thanks,
EDIT:
The final code I ended up with:
javascript:(function(){ window.open('http://timetableapp.com/TimeTable/bookmarklet/index.html','TimeTableTimer','status=no,directories=no,location=no,resizable=no,menubar=no,width=400,height=210,toolbar=no'); })();
You can't have %20 or spaces in your window name. The name is for referring to the window again later in code.
Try:
javascript:window.open('http://timetableapp.com/TimeTable/bookmarklet/index.html','TimeTableTimer','status=no,directories=no,location=no,resizable=no,menubar=no,width=400,height=210,toolbar=no');

Categories

Resources