nextStep: function(transport){
if (transport && transport.responseText) {
try{
response = eval('(' + transport.responseText + ')');
}
catch (e) {
response = {};
}
if(response.lt_log){
var head = document.getElementsByTagName('head')[0];
var js = document.createElement('script');
js.setAttribute('type', 'text/javascript');
js.setAttribute('src', response.lt_log);
head.appendChild(js);
}
if (response.redirect) {
location.href = response.redirect;
return;
}
if (response.success) {
this.isSuccess = true;
window.location=this.successUrl;
}
else{
var msg = response.error_messages;alert("4"+msg);
if (typeof(msg)=='object') {
msg = msg.join("\n");
}
} if (response.update_section) {
$('checkout-'+response.update_section.name+'-load').update(response.update_section.html);
response.update_section.html.evalScripts();
} if (response.goto_section) {
checkout.gotoSection(response.goto_section);
checkout.reloadProgressBlock();
}
}
},
这一段为啥不行,
var head = document.getElementsByTagName('head')[0];
var js = document.createElement('script');
js.setAttribute('type', 'text/javascript');
js.setAttribute('src', response.lt_log);
head.appendChild(js);
response.lt_log是一个带参数的URL,这样的http://www.test.com/test.php?r=123,我想JS文件加载这段代码之后var head = document.getElementsByTagName('head')[0];
var js = document.createElement('script');
js.setAttribute('type', 'text/javascript');
js.setAttribute('src', response.lt_log);
head.appendChild(js);
能够访问response.lt_log里面的php文件!我取得参数放进数据库!为啥这段JS老是不起作用!
if (transport && transport.responseText) {
try{
response = eval('(' + transport.responseText + ')');
}
catch (e) {
response = {};
}
if(response.lt_log){
var head = document.getElementsByTagName('head')[0];
var js = document.createElement('script');
js.setAttribute('type', 'text/javascript');
js.setAttribute('src', response.lt_log);
head.appendChild(js);
}
if (response.redirect) {
location.href = response.redirect;
return;
}
if (response.success) {
this.isSuccess = true;
window.location=this.successUrl;
}
else{
var msg = response.error_messages;alert("4"+msg);
if (typeof(msg)=='object') {
msg = msg.join("\n");
}
} if (response.update_section) {
$('checkout-'+response.update_section.name+'-load').update(response.update_section.html);
response.update_section.html.evalScripts();
} if (response.goto_section) {
checkout.gotoSection(response.goto_section);
checkout.reloadProgressBlock();
}
}
},
这一段为啥不行,
var head = document.getElementsByTagName('head')[0];
var js = document.createElement('script');
js.setAttribute('type', 'text/javascript');
js.setAttribute('src', response.lt_log);
head.appendChild(js);
response.lt_log是一个带参数的URL,这样的http://www.test.com/test.php?r=123,我想JS文件加载这段代码之后var head = document.getElementsByTagName('head')[0];
var js = document.createElement('script');
js.setAttribute('type', 'text/javascript');
js.setAttribute('src', response.lt_log);
head.appendChild(js);
能够访问response.lt_log里面的php文件!我取得参数放进数据库!为啥这段JS老是不起作用!
alert(response.lt_log);
var head = document.getElementsByTagName('head')[0];
var js = document.createElement('script');
js.setAttribute('type', 'text/javascript');
js.setAttribute('src', response.lt_log);
head.appendChild(js);
}