Im kind of new to javascript so please excuse me if this in a stupid question.
I have a website which shows a couple of graphs. The problem is that these graphs are drawn when the page is loaded which means that they keep their original size even if the width/height of the screen is changed. This has not been a problem on the desktop version but now I want to make it work on my iPhone and iPad aswell. This means that the graphs needs to be reloaded when I swap from portrait to landscape, and the other way around.
I have tried to solve this by adding a "onResize" to the body-tag. This works perfect when I resize my browser window in desktop mode and it also works fine on my iPhone. BUT the iPad gets caught in an infinite loop! WHY?
Please help me with this problem, I have spent faar to may hours on it now...
Here's the code I use:
In Header:
<script type="text/javascript">
function myfunction(){window.location.href = window.location.href;}
</script>
And in body:
<body onresize="myfunction()">