I made this javascript and tried but never works.
It has to show advertising banner.
If I put this iframe on out side of javascript tag, it works fine but I did put inside of javascript tag because iframe will be decided depending one the width of browser window.
How can I make this work????
<head>
<script type="text/javascript">
width = jQuery(".pagenator").width();
if (width > 730) {
<iframe frameborder='0' allowtransparency='true' marginheight='0' marginwidth='0' scrolling='no' width='728' height='90' src='http://foofoofoofootest.com/adspot.aspx?id=21442?'>
</iframe>
} else if (width > 470) {
<iframe frameborder='0' allowtransparency='true' marginheight='0' marginwidth='0' scrolling='no' width='468' height='60' src='http://foofoofoofootest.com/adspot.aspx?id=21443?'>
</iframe>
} else if (width > 255) {
<iframe frameborder='0' allowtransparency='true' marginheight='0' marginwidth='0' scrolling='no' width='250' height='250' src='http://foofoofoofootest.com/adspot.aspx?id=21444?'>
</iframe>
} else {
<iframe frameborder='0' allowtransparency='true' marginheight='0' marginwidth='0' scrolling='no' width='200' height='200' src='http://foofoofoofootest.com/adspot.aspx?id=21445?'>
</iframe>
}
</script>
<head>
<body>
</body>
</html>
UPDATE
<body>
<script type="text/javascript">
var TheHTML = "";
width = jQuery(".pagenator").width();
if (width > 730) {
TheHTML = "<iframe frameborder='0' allowtransparency='true' marginheight='0' marginwidth='0' scrolling='no' width='728' height='90' src='http://foofoofoofootest.com/adspot.aspx?id=21442'></iframe>";
} else if (width > 470) {
TheHTML = "<iframe frameborder='0' allowtransparency='true' marginheight='0' marginwidth='0' scrolling='no' width='468' height='60' src='http://foofoofoofootest.com/adspot.aspx?id=21443'></iframe>";
} else if (width > 255) {
TheHTML = "<iframe frameborder='0' allowtransparency='true' marginheight='0' marginwidth='0' scrolling='no' width='250' height='250' src='http://foofoofoofootest.com/adspot.aspx?id=21444'></iframe>";
} else {
TheHTML = "<iframe frameborder='0' allowtransparency='true' marginheight='0' marginwidth='0' scrolling='no' width='200' height='200' src='http://foofoofoofootest.com/adspot.aspx?id=21445'></iframe>";
}
$("#frameHolder").html(TheHTML);
</script>
<div id="frameHolder"></div>
</body>
media queriesanddisplay: none;and thendisplay: block;. You don't need to useJSfor something that can be done withCSS