wright67uk Posted January 1, 2013 Share Posted January 1, 2013 Hello, im very new to Ajax and have a problem with IE applying styles to my page I have a php page with a call to another php page... <html> <head> <script> function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","get_snag_score.php?q="+str,true); xmlhttp.send(); } </script> <style type="text/css"> input[type=text] {width: 40px} #formwrap {background-color:#0CC; width:300px; margin-left:auto; margin-right:auto; -moz-border-radius: 15px; border-radius: 15px; padding-left:40px; min-height:400px; } input.clip {background-color:#0CC; color:#fff; font-family:Tahoma, Geneva, sans-serif; font-weight:bold;} h2.location {color:#fff; font-family:Tahoma, Geneva, sans-serif; font-weight:bold;} </style> </head> <body> <?php php connection and query etc... ?> <div id="formwrap"> <form> <select name="location" onchange="showUser(this.value)"> <option value="">Select a Scorecard:</option> <?php echo $options ?></select> </form> <div id="txtHint"></div> <a href="snag.php">Menu</a> </div> </body> </html> The second page contains a form, and the styles for the form are in the page shown above.... IE doesn't appear to apply any css to my form in the page that I call, where as chrome and firefox do. Is this a common issue and what is the correct procedure when using css and ajax? Ive tried moving the css to the top of my page with no effect. Quote Link to comment https://forums.phpfreaks.com/topic/272595-ajax-and-css/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.