Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Dynamic menu in IE

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-28-2007, 06:51 AM
 
Lee Lee is offline
 

Advanced Member
  
Join Date: Dec 2002
Posts: 95
 

Default Dynamic menu in IE

Afternoon all,

I have implemented a new vertical dropdown menu for our main navigation panel, which is quick and easily maintainable, and will glady share if I get this problem fixed!!

It works like a dream in Netsacpe and Firefox but despite testing it in IE, once I have got all the code into the store templates I get a javascript error in IE.

Line: 122
Char: 21
Error: Invalid argument
Code: 0

Now, first point of call was to look at the source code for the page determine what is on line 122 and fix! On first look the line 122 contained some javascript from the call in rectangle_top.tpl regarding -

function substitute(lbl) {

Now I have commented out all the javascript from rectangle_top.tpl hoping to corner the error and fix, but despite removing this I still get the same javascript error in IE, same line number etc, except this time because the xcart javascript has been removed, line 122 now contains just some simple HTML code.

So how can I identify where this error is coming from? I can;t work out from the IE popup containing the error message where the problem is.

Any javascript gurus out there that can point me in the right direction??

Thanks in advance
__________________
Lee

X-Cart 4.0.14 - heavily modified! (Linux)
www.lasertechgroup.com/uk
Reply With Quote
  #2  
Old 02-28-2007, 08:20 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Dynamic menu in IE

You may not be looking at the correct line 122...post a url and someone can have a look.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 02-28-2007, 08:30 AM
 
Lee Lee is offline
 

Advanced Member
  
Join Date: Dec 2002
Posts: 95
 

Default Re: Dynamic menu in IE

http://www.lasertechgroup.com/12ls06dev/product.php?productid=35677

It can;t be line 122 of the source code of this page if you view source and identify line 122 (which at the moment is the javascript from rectangle_top.tpl). Even if I remove this it still returns the error at line 122.

I just don;t know where to look for it, amd baffled!

Thanks,
__________________
Lee

X-Cart 4.0.14 - heavily modified! (Linux)
www.lasertechgroup.com/uk
Reply With Quote
  #4  
Old 02-28-2007, 08:35 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Dynamic menu in IE

Did you put {literal} tags around your menu code? The two may be clashing:

{literal}

menu code here
{/literal}
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 03-01-2007, 12:42 AM
 
Lee Lee is offline
 

Advanced Member
  
Join Date: Dec 2002
Posts: 95
 

Default Re: Dynamic menu in IE

I thought {literal} tags were only really used within javascript?

I only have a call to the js file in the <head>.

The menu itself sits in
<table width="623" border="0" cellpadding="0" cellspacing="0" id="menu1" class="ddmx">

and then each section is held within a cell
<a class="item1" href="home.php?cat=6161"><img src="{$ImagesDir}/nav/op2off.gif" width="97" height="46" border="0" alt="Paper Supplies" onmouseover="this.src='{$ImagesDir}/nav/op2on.gif'" onmouseout="this.src='{$ImagesDir}/nav/op2off.gif'" /></a>
<div class="section">
<a class="item2 arrow" href="home.php?cat=6639">A4 Paper<img src="{$ImagesDir}/arrow1.gif" width="10" height="12" alt="" /></a>
<div class="section">
<a class="item2" href="home.php?cat=6191">Paper A4 80gsm</a>
<a class="item2" href="home.php?cat=6193">Paper A4 90gsm</a>
<a class="item2" href="home.php?cat=6194">Paper A4 100gsm</a>
<a class="item2" href="home.php?cat=6195">Paper A4 110gsm</a>
<a class="item2" href="home.php?cat=6196">Paper A4 120gsm</a>
<a class="item2" href="home.php?cat=6667">Other</a>
</div>
<a class="item2 arrow" href="home.php?cat=6640">A3 Paper<img src="{$ImagesDir}/arrow1.gif" width="10" height="12" alt="" /></a>
<div class="section">
<a class="item2" href="home.php?cat=6192">Paper A3 80gsm</a>
<a class="item2" href="home.php?cat=6669">Other</a>
</div>
</div>

I have tried your suggestion around the above code with no success. I am going to remove sections of the site one by one and try to pinpoint the area that is producing that error.

Thanks
__________________
Lee

X-Cart 4.0.14 - heavily modified! (Linux)
www.lasertechgroup.com/uk
Reply With Quote
  #6  
Old 03-01-2007, 01:38 AM
 
Lee Lee is offline
 

Advanced Member
  
Join Date: Dec 2002
Posts: 95
 

Default Re: Dynamic menu in IE

DOH!

Of course there is a javascript call, I'd just hidden it at the bottom of head.tpl

<script type="text/javascript">
var ddmx = new DropDownMenuX('menu1');
ddmx.delay.show = 0;
ddmx.delay.hide = 400;
ddmx.position.levelX.left = 2;
ddmx.init();
</script>

However I have put literal tags in to no effect, do they go outside or inside the script tag?
__________________
Lee

X-Cart 4.0.14 - heavily modified! (Linux)
www.lasertechgroup.com/uk
Reply With Quote
  #7  
Old 03-01-2007, 02:42 AM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: Dynamic menu in IE

it goes outside

anything that has braces {} that has nothing to do with smarty should be wrapped in {literal}{/literal} tags
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote
  #8  
Old 03-01-2007, 03:44 AM
 
Lee Lee is offline
 

Advanced Member
  
Join Date: Dec 2002
Posts: 95
 

Default Re: Dynamic menu in IE

Thanks for your input guys.

I have found the source of the problem, nothing to do with the literal tags (although I have now put them in )

In rectangle_top.tpl i have the call to the js and the start of a table -

<table border="0" cellpadding="0" cellspacing="0" width="{$width|default:"100%"}" height="100%">
<tr>
<td valign="top"><div style="position: absolute;" id="div_null"></div>

If I remove the above code, the menu works in IE. At first I thought it was the div id call, but even if I just remove the <div></div> I still get that js error, if I remove the start os this table, row and cell, the error disappears!

Now b4 I get too elated, can anyone tell me what this id=div_null does?

Thanks
__________________
Lee

X-Cart 4.0.14 - heavily modified! (Linux)
www.lasertechgroup.com/uk
Reply With Quote
  #9  
Old 12-05-2007, 09:09 PM
  jonc's Avatar 
jonc jonc is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 53
 

Default Re: Dynamic menu in IE

OK, I'm having the same problem with DropDownMenuX.js and the same basic error code (line 122...).

The problem happens in product view with the javascript in product options. the price does not update for variants. The menu works ok, but the product_options mod crashes.

if I remove the javascript file call in the header to DropDownMenuX.js, then the menu stops working (obviously) and the variants update like they are supposed to.

Lee, How did you get this working (the table tags above are not part of the problem)?
__________________
jonc
X-Cart Gold 4.1.10 - http://www.hypnoskates.com
X-Cart Gold 4.1.10 - http://tryten.com/shop/
X-Cart Gold 4.1.10 - http://www.bluecurl.ca/shop/
Reply With Quote
  #10  
Old 12-06-2007, 08:24 AM
  jonc's Avatar 
jonc jonc is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 53
 

Default Re: Dynamic menu in IE

It is a problem with the array object clashing between the menu and Product_Options module. to see the solution and download a patch go here:

http://forum.x-cart.com/showthread.php?t=34052
__________________
jonc
X-Cart Gold 4.1.10 - http://www.hypnoskates.com
X-Cart Gold 4.1.10 - http://tryten.com/shop/
X-Cart Gold 4.1.10 - http://www.bluecurl.ca/shop/
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:28 AM.

   

 
X-Cart forums © 2001-2020