0

提供的以下代码用于在我的网站上购买包裹。有关我的问题的示例,请访问http://www.gldesert.com/donate/packages/ranks/?checkbox1=on&checkbox2=on&checkbox3=on&submit=PROCEED+%3AD。单击“添加到购物车”按钮时,它会打开 Buycraft 的弹出窗口,这是一个 Minecraft 购物车。但是,如果您将另一个项目添加到购物车,它会关闭弹出窗口。如何保持打开状态?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<html class="no-js" lang="pt-BR" dir="ltr" xml:lang="pt-BR">
<meta name="google" value="notranslate">    
    <link rel="stylesheet" href="/css/reset.css" type="text/css" media="screen">
    <link rel="stylesheet" href="/css/ranksstyle.css" type="text/css" media="screen">
    <link rel="stylesheet" href="/css/grid.css" type="text/css" media="screen">    
    <script src="/js/jquery-1.6.2.min.js" type="text/javascript"></script> 
    <script src="/js/jquery.easing.1.3.js" type="text/javascript"></script>
    <script src="/js/tms-0.3.js" type="text/javascript"></script>
    <script src="/js/tms_presets.js" type="text/javascript"></script>
    <script src="/js/cufon-yui.js" type="text/javascript"></script>
    <script src="/js/cufon-replace.js" type="text/javascript"></script>
    <script src="/js/FF-cache.js" type="text/javascript"></script>
    <script src="/js/Kozuka_Gothic_Pro_OpenType_700.font.js" type="text/javascript"></script>        
    <script src="/js/Kozuka_Gothic_Pro_OpenType_500.font.js" type="text/javascript"></script>            
    <script src="/js/tabs.js" type="text/javascript"></script>      
    <script src="/js/superfish.js" type="text/javascript"></script>         
    <script src="/js/jquery.mousewheel.js" type="text/javascript"></script>              
    <script src="/js/jScrollPane.js" type="text/javascript"></script>         
    <script src="/js/script.js" type="text/javascript"></script> 
    <script src="/js/jquery.iframe.js"></script>   
    <script src="/js/jquery.collapse.js"></script> 

<style type="text/css"> 
.menutitle{ 
cursor:pointer; 
margin-bottom: 5px; 
background-color:#ECECFF; 
color:#000000; 
width:140px; 
padding:2px; 
text-align:center; 
font-weight:bold; 
/*/*/border:1px solid #000000;/* */ 
} 

.submenu{ 
margin-bottom: 0.5em; 
} 
</style>   
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-30249399-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-30249399-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
<script type="text/javascript"> 

var persistmenu="no" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc) 
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only 

if (document.getElementById){ //DynamicDrive.com change 
document.write('<style type="text/css">\n') 
document.write('.submenu{display: none;}\n') 
document.write('</style>\n') 
} 

function SwitchMenu(obj){ 
if(document.getElementById){ 
var el = document.getElementById(obj); 
var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change 
if(el.style.display != "block"){ //DynamicDrive.com change 
for (var i=0; i<ar.length; i++){ 
if (ar[i].className=="submenu") //DynamicDrive.com change 
ar[i].style.display = "none"; 
} 
el.style.display = "block"; 
}else{ 
el.style.display = "none"; 
} 
} 
} 

function get_cookie(Name) { 
var search = Name + "=" 
var returnvalue = ""; 
if (document.cookie.length > 0) { 
offset = document.cookie.indexOf(search) 
if (offset != -1) { 
offset += search.length 
end = document.cookie.indexOf(";", offset); 
if (end == -1) end = document.cookie.length; 
returnvalue=unescape(document.cookie.substring(offset, end)) 
} 
} 
return returnvalue; 
} 

function onloadfunction(){ 
if (persistmenu=="yes"){ 
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname 
var cookievalue=get_cookie(cookiename) 
if (cookievalue!="") 
document.getElementById(cookievalue).style.display="block" 
} 
} 

function savemenustate(){ 
var inc=1, blockid="" 
while (document.getElementById("sub"+inc)){ 
if (document.getElementById("sub"+inc).style.display=="block"){ 
blockid="sub"+inc 
break 
} 
inc++ 
} 
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname 
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid 
document.cookie=cookiename+"="+cookievalue 
} 

if (window.addEventListener) 
window.addEventListener("load", onloadfunction, false) 
else if (window.attachEvent) 
window.attachEvent("onload", onloadfunction) 
else if (document.getElementById) 
window.onload=onloadfunction 

if (persistmenu=="yes" && document.getElementById) 
window.onunload=savemenustate 

</script> 
<body>
<center>
<div class="main">
  <header>
        <div class="inner">
            <div class="container">
                <h1><a href="/">GLD</a></h1>
                <ul class="login_panel">
                    <li></li>
                    <li></li>
                </ul>
                <ul class="links">
                <img style="width: 360px; height: 75px;" src="http://cache.multiplayuk.com/b/1-218175-560x95-2173-FFD117-FFFFFF.png" alt="" />
                </ul>
            </div>
        </div>        <div class="menu_block">
            <div class="container">
                <nav>
                    <ul class="sf-menu">
                        <li class="active"><a href="/donate">Donate</a>
                        <li><a href="/donate/packages/special">Special Packages!</a></li>
                        <li><a href="/donate/packages/upgrades">Rank Upgrades</a></li>
                        <li><a href="/donate/packages/mcmmo">McMMO Points</a></li>
                        <li><a href="/donate/packages/lightstones">Lightstones</a></li>
    <p>&nbsp;</p>
                    </ul>
                    <div class="clear"></div>
                </nav>
            </div>
        </div>
</a>
</b>
</ul>
<div id="main"></li>
<center>
<div id="main"></li>
    <center>
    <p>&nbsp;</p>
    <p>&nbsp;</p> 
<div class="block small left" style="width:99%;">               
        <table cellpadding="0" cellspacing="0" width="99%">
<div id="masterdiv"> 

<div onclick="SwitchMenu('sub1')"></div> 
<span class="submenu" id="sub1"> 
<h2>
<script>
$("iframe").src(url, optionalCallback, options); $("iframe").squirt(html, optionalCallback, options);
</script>
<script>
$("<iframe name='ajaxForm' />").src("http://gldesert.com/donate/transfer.php").attr('scrolling','no').width("1000").height("620").appendTo("h2");

$("iframe").src("http://gldesert.com/donate/transfer.php", function(iframe, duration) {;
}, {
  timeout: function() { alert("Oh no! The donation page is having an issue :( It will surely get fixed soon! Check back later and tell Joan!"); },
  timeoutDuration: 10000
});
</script>
</h2>
            <tbody>

                        <tr>
                            <td style="text-align:left;"><strong>Sand Traveler</strong></td>
                            <td style="text-align:right;"><strong>4.99 USD</strong></td>            
                            <td style="text-align:right;">
                                <form method="POST" action="https://buycraft.net/redirect/addcart/2031/2511" target="ajaxForm">
                                    <input type="submit" value="Add to Cart" class="submit" class="menutitle" onclick="SwitchMenu('sub1')">
                                </form>
                            </td>
                        </tr>                                   
                        <tr>
                            <td style="text-align:left;"><strong><span style="color: #7FF07F;">VIP</span></strong></td>
                            <td style="text-align:right;"><strong>14.99 USD</strong></td>            
                            <td style="text-align:right;">
                                <form method="POST" action="https://buycraft.net/redirect/addcart/2031/2489" target="ajaxForm">
                                    <input type="submit" value="Add to Cart" class="submit" class="menutitle" onclick="SwitchMenu('sub1')">
                                </form>
                            </td>
                        </tr>               
                        <tr>
                            <td style="text-align:left;"><strong><span style="color: #00BF00;">Premium</span></strong></td>
                            <td style="text-align:right;"><strong>29.99 USD</strong></td>            
                            <td style="text-align:right;">
                                <form method="POST" action="https://buycraft.net/redirect/addcart/2031/2517" target="ajaxForm">
                                    <input type="submit" value="Add to Cart" class="submit" class="menutitle" onclick="SwitchMenu('sub1')">
                                </form>
                            </td>
                        </tr>                       
                        <tr>
                            <td style="text-align:left;"><strong><span style="color: #5252FA;">Exiled</span></strong></td>
                            <td style="text-align:right;"><strong>39.99 USD</strong></td>            
                            <td style="text-align:right;">
                                <form method="POST" action="https://buycraft.net/redirect/addcart/2031/2520" target="ajaxForm">
                                    <input type="submit" value="Add to Cart" class="submit" class="menutitle" onclick="SwitchMenu('sub1')">
                                </form>
                            </td>
                        </tr>


                        <tr>
                            <td style="text-align:left;"><strong><span style="color: #B500B5;">Captain [Most Popular!]</span></strong></td>
                            <td style="text-align:right;"><strong>69.99 USD</strong></td>            
                            <td style="text-align:right;">
                                <form method="POST" action="https://buycraft.net/redirect/addcart/2031/2521" target="ajaxForm">
                                    <input type="submit" value="Add to Cart" class="submit" class="menutitle" onclick="SwitchMenu('sub1')">
                                </form>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;"><strong><span style="color: #00AAAA;">Veteran! [NEW!]</span></strong></td>
                            <td style="text-align:right;"><strong>99.00 USD</strong></td>            
                            <td style="text-align:right;">
                                <form method="POST" action="https://buycraft.net/redirect/addcart/2031/70786" target="ajaxForm">
                                    <input type="submit" value="Add to Cart" class="submit" class="menutitle" onclick="SwitchMenu('sub1')">
                                </form>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;"><strong><span style="color: #E3C100;">1337</span></strong></td>
                            <td style="text-align:right;"><strong>133.70 USD</strong></td>            
                            <td style="text-align:right;">
                                <form method="POST" action="https://buycraft.net/redirect/addcart/2031/2522" target="ajaxForm">
                                    <input type="submit" value="Add to Cart" class="submit" class="menutitle" onclick="SwitchMenu('sub1')">
                                </form>
                            </td>
                        </tr>

                        <tr>
                            <td style="text-align:left;"><strong><span style="color: #FF5757;">Desert Sage</span></strong></td>
                            <td style="text-align:right;"><strong>79.99! <del>159.99 USD</del></strong></td>            
sale                            <td style="text-align:right;">
                                <form method="POST" action="https://buycraft.net/redirect/addcart/2031/2524" target="ajaxForm">
                                    <input type="submit" value="Add to Cart" class="submit" class="menutitle" onclick="SwitchMenu('sub1')">
                                </form>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;"><strong><span style="color: #0000E3;">Dark King</span></strong></td>
                            <td style="text-align:right;"><strong>99.99! <del>199.99 USD</del></strong></td>            
                            <td style="text-align:right;">
                                <form method="POST" action="https://buycraft.net/redirect/addcart/2031/3100" target="ajaxForm">
                                    <input type="submit" value="Add to Cart" class="submit" class="menutitle" onclick="SwitchMenu('sub1')">
                                </form>
                            </td>
                        </tr>



</center>
</body>
      </li>
      </ul>
    </blockquote>
    </div>
<h3><p style="color:#FF0000">IMPORTANT!: Please Do NOT Use Internet Explorer! It will not work...!  CHROME, FIREFOX, ETC WILL WORK!</p></h3>
<h3><p style="color:#FF0000">IF YOU REALLY MUST, GO TO THIS PAGE:<a href="http://gldesert.buycraft.net/">CLICK HERE</a></p></h3>
<h3><a><p style="color:#FF0000">50% OFF DESERT SAGE & DARK KING!</a></p></h3>
<br> 

</span> 


</div>
</html>
4

2 回答 2

1

我的朋友,你应该从根本上减少你的 JavaScript 堆栈。首先,从 font-face 而不是 cufon 开始。然后,使用较新版本的 jquery。然后,看看会发生什么。

你那里的脚本太多了。错误和冲突是意料之中的。另外,我注意到您在代码中使用了“getElementById”。您的页面中有 jquery。用它。

于 2012-11-12T07:21:48.073 回答
0

即使你保持它以这种方式启用整个系统功能,它也会给你一个错误:

该包裹已经存在于篮子中。

一旦他/她进行结帐,用户应该可以选择更改商品数量。我相信,如果您仍想启用“按钮”,则还需要调整服务器端脚本,因为它会返回错误...

于 2012-11-12T07:26:58.230 回答