I need some help. I'm loading a .php file using jquery. the php is a mysql query that pulls all the cities from Alaska. The problem is that I wrote my query a certain way and it seems jquery changes it when it loads it.
state_alaska.php
include 'config.php';
include 'opendb.php';
$AK = mysql_query("SELECT id, city, state FROM city WHERE state ='AK' ORDER BY city ASC") or die(mysql_error());
while ( $row = mysql_fetch_array($AK) ) {
$page = "1";
echo "<div class='city'><a href='catagories.php?state=".urlencode($row["state"]) ."&city=".urlencode($row["city"])." &page=".$page."'/>".$row["city"] . "</a></div>";
}
include 'closedb.php';
Jquery load
$('#ak').load("state_alaska.php");
Source code
<div id="ak" style="display: block; ">
<div class="city">
<a href="catagories.php?state=AK&city=Anchorage&page=1"></a>
Anchorage
</div>
<div class="city">
<a href="catagories.php?state=AK&city=Bethel+&page=1"></a>
Bethel
</div>
<div class="city">
<a href="catagories.php?state=AK&city=Fairbanks+&page=1"></a>
Fairbanks
</div>
<div class="city">
<a href="catagories.php?state=AK&city=Homer+&page=1"></a>
Homer
</div>
<div class="city">
<a href="catagories.php?state=AK&city=Juneau&page=1"></a>
Juneau
</div>
<div class="city">
<a href="catagories.php?state=AK&city=Kenai+&page=1"></a>
Kenai
</div>
<div class="city">
<a href="catagories.php?state=AK&city=Ketchikan+&page=1"></a>
Ketchikan
</div>
<div class="city">
<a href="catagories.php?state=AK&city=Kodiak+&page=1"></a>
Kodiak
</div>
</div>
In the code I never asked it to display block or to close the </a>'s I dont know why its doing that.. can anyone help?