I'm using Jquery to load an HTML page into a <div>
. My code is working correctly, however it is not passing a value via GET that I need on another page:
<!DOCTYPE html>
<html>
<head>
<title>Exemplo</title>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="js/js_1.9/jquery-1.8.2.js"></script>
<script type="text/javascript" src="js/js_1.9/jquery-ui-1.9.1.custom.min.js"></script>
</head>
<body>
<div id="sidebar">
<ul>
<li><a onclick="carregar('receita.html?cod=1')" href="#">Receita 1</a></li>
<li><a onclick="carregar('receita.html?cod=2')" href="#">Receita 2</a></li>
</ul>
</div>
<div id="conteudo"></div>
</body>
<script>
function carregar(pagina){
$("#conteudo").load(pagina);
}
</script>
</html>
I'm using a function on page receita.html
that retrieves the variable cod
So, if I open in the browser receita.html?cod=10
it retrieves this variable, but opening the content inside the <div>
it even opens the page, but it does not retrieve cod
.
Does anyone have any idea how I can resolve this?