script xsite.js ima u sebi:
Kôd:
function xsite_call(url, params) {
if(params && typeof params == 'object') {
var query = '';
for(key in params) {
query += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]) + '&';
}
url += '?' + query;
}
var ifrm = document.createElement( 'iframe' );
ifrm.src = url;
document.body.appendChild( ifrm );
}
u proba.htm:
HTML kôd:
<html>
<head>
<script type="text/javascript" src="xsite.js"></script>
<script type="text/javascript">
function init() {
if(location.hash) {
alert(location.hash);
} else {
xsite_call('proba1.htm');
}
}
</script>
</head>
<body onload="init()">
</body>
</html>
a u proba1.htm, isto to, samo se poziva:
Kôd:
function init() {
xsite_call('proba.htm#bla');
}
generisani kod i urlovi su ok, jedino se ovaj drugi iframe nece ucitati..