Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/272595-ajax-and-css/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.