0

The following code provided is for buying packages on my website. For an example of my issue, go to http://www.gldesert.com/donate/packages/ranks/?checkbox1=on&checkbox2=on&checkbox3=on&submit=PROCEED+%3AD. When clicking the Add to Cart button, it opens the pop-up to Buycraft, a Minecraft shopping cart. But if you add another item to the cart, it closes the pop-up. How do I keep it open?

<!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>

2 Answers 2

1

My friend, you should radically reduce your javascript stack here. First, start with font-face instead of cufon. Then, use newer version of jquery. Then, see what happens.

You have way too many scripts there. Bugs and conflicts are to be expected. Also, I notice you are using "getElementById" in your code. You have jquery in your page. Use it.

Sign up to request clarification or add additional context in comments.

4 Comments

This isn't my code. It's a friends. I'm rewriting it all for him, organizing, etc. but this was his main bug and idk how to fix it.
Reduce number of scripts. That complexity shall almost always throw some conflicts. Besides, so many requests radically slow down your page load
How would you recommend I do so?
I told you. Replace cufon with font face for start. For other stuff, I don't know what each script does. Maybe you can get rid of scripts and replace them.
0

Even if you keep it enabled the whole system function that way and it will give you an error:

That package already exists in the basket.

There should be an option for a user to change the number of items once he/she proceed to checkout. I believe that if you still want to enable the "button" you will need to tweak your server side scripts as well since it returns an error...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.