我将页面加载到div中。我无法在page1.php
中执行javascript代码。当我将页面加载到div时,如何执行代码?谢谢你的帮助
// <![CDATA[
function hide(id) {
var divObject = document.getElementById(id);
divObject.style.display = "none";
}
function show(id) {
var divObject = document.getElementById(id);
divObject.style.display = "block";
}
// ]]>
-- >
// <![CDATA[
function fthrkl() {
var objemiz;
/*@cc_on @*/
/*@if (@_jscript_version >= 5 ) try { objemiz = new ActiveXObject("Msxml2.XMLHTTP" ); }
catch (e ) {
try { objemiz = new ActiveXObject("Microsoft.XMLHTTP" ); }
catch (E ) { objemiz = false; }
}@end @*/
if (!objemiz && typeof XMLHttpRequest != 'undefined') {
try {
objemiz = new XMLHttpRequest();
} catch (e) {
objemiz = false;
}
}
return objemiz;
}
function git(degerler, syf, alanadi) {
gonder = new fthrkl();
gonder.onreadystatechange = function() {
document.getElementById(alanadi).innerHTML = "<div class=yukle_pencere><div class=yukle><img src=images/load.gif align=center ></div><div class=yukle_yazi>Yükleniyor</div></div>";
if (gonder.readyState == 4) {
document.getElementById(alanadi).innerHTML = gonder.responseText;
function fthrkl() {};
}
}
gonder.open('GET', syf + '?' + degerler, true);
gonder.send(null);
}
function git2(degerler2, syf2, alanadi2) {
gonder2 = new fthrkl();
gonder2.onreadystatechange = function() {
document.getElementById(alanadi2).innerHTML = "<center><img src=/images/loading.gif border=0 align=center ></center>";
if (gonder2.readyState == 4) {
document.getElementById(alanadi2).innerHTML = gonder2.responseText;
function fthrkl() {};
}
}
gonder2.open('GET', syf2 + '?' + degerler2, true);
gonder2.send(null);
location.reload();
}
function git3(degerler3, syf3, alanadi3) {
gonder3 = new fthrkl();
gonder3.onreadystatechange = function() {
document.getElementById(alanadi3).innerHTML = "<center><img src=/images/loading.gif border=0 align=center ></center>";
if (gonder3.readyState == 4) {
document.getElementById(alanadi3).innerHTML = gonder3.responseText;
function fthrkl() {};
}
}
gonder3.open('GET', syf3 + '?' + degerler3, true);
gonder3.send(null);
}
function git5(degerler5, syf5, alanadi5) {
gonder5 = new fthrkl();
gonder5.onreadystatechange = function() {
document.getElementById(alanadi5).innerHTML = "<label class='control-label'>Firma Ünvanı</label><div class='controls'><input type='text' class='input-xlarge' id='FirmaAdi' name='FirmaAdi' value='Firma Seçmediniz' disabled><button class='btn' type='button'><i class='icon-refresh'></i> </button></div>";
if (gonder5.readyState == 4) {
document.getElementById(alanadi5).innerHTML = gonder5.responseText;
function fthrkl() {};
}
}
gonder5.open('GET', syf5 + '?' + degerler5, true);
gonder5.send(null);
}
function git4(degerler4, syf4, alanadi4) {
gonder4 = new fthrkl();
gonder4.onreadystatechange = function() {
document.getElementById(alanadi4).innerHTML = "<div class='alert alert-info'><i class='fa fa-info-circle'></i> Yükleniyor...</div>";
if (gonder4.readyState == 4) {
document.getElementById(alanadi4).innerHTML = gonder4.responseText;
function fthrkl() {};
}
}
gonder4.open('GET', syf4 + '?' + degerler4, true);
gonder4.send(null);
location.reload();
}
// ]]>
-- >
&#13;
#overlay {
position: fixed;
top: 0px;
left: 0px;
height: 100%;
width: 100%;
z-index: 9999999;
background: url(../panel/img/popupb.png);
display: none;
}
.pencere {
position: absolute;
width: 500px;
margin: -100px 0px 0px -250px;
top: 25%;
left: 50%;
text-align: left;
padding: 0px;
z-index: 99999999;
}
.pencere_ic {
font-weight: normal;
border-color: #01a161;
background: #FFF;
border-radius: 0px;
padding: 0px;
border-width: 3px 0px 0px 0px;
border-top: 3px solid #01a161;
}
.yukle_pencere {
margin: auto;
width: 250px;
height: 70px;
background-color: white;
font-weight: normal;
}
.yukle {
text-align: center;
padding: 10px;
z-index: 9000;
}
.yukle_yazi {
text-align: center;
font-size: 13px;
color: gray;
}
.yukle_pencere1 {
margin-bottom: 18px;
display: block;
}
.yukle1 {
text-align: center;
padding: 5px;
z-index: 9000;
}
.yukle_yazi1 {
text-align: center;
font-size: 13px;
color: green;
}
&#13;
<button type="submit" class="sppb-btn sppb-btn-primary" onclick="$('body').scrollTop(0);show('pencere');show('overlay');git('uid=666&odemetur=0&durum=0&makbuz='+document.getElementById('makbuz').value+'&tutar='+document.getElementById('tutar').value+'&adne='+document.getElementById('adne').value+'&OdemeYil='+document.getElementById('OdemeYil').value+'&aciklama='+document.getElementById('aciklama').value+'&OdemeAy='+document.getElementById('OdemeAy').value,'ajax/tahsilat.asp','pencere');"><i class="fa"></i> Gönder</button>
<div class="pencere" id="pencere"></div>
<div id="overlay"></div>
&#13;
感谢您的帮助