code += init.join(';')+';';
and
for (i = 0; i < jsl-1; i++) code += init[i]+';';
Don't output the same.
For "" the first one will be ";" the second one will stay ""
It's possible that IE has an issue with eval(";"); if I understand this
thread right.
Side note, you should be using for (var i = 0
~Daniel Friesen (Dantman, Nadir-Seen-Fire)
Gilles wrote:
> Ok, I don't have the bug anymore, but my script is no longer working
> (and I know why so at least I know where to look)
>
> For information purposes all I did was changed this line
>
> code += init.join(';')+';';
>
> to this line and the error message went away
>
> for (i = 0; i < jsl-1; i++) code += init[i]+';';
>
> only issue is, I use an alert to display code afterward and this is
> what happens:
>
> 1. When the first line is used the alert will display the code to eval
> perfectly, but the error message will be there and the code doesn't
> work
> 2. When the second line is used the alert is blank, and of course
> there is no error because it eval('');
>
> Note the jsl-1 is temporary it's just in my example need the ui core
> so removed 1 out of the new length to avoid undefined being inserted
> in the code, at start I thought that it was the reason for the alert
> being blank, but it isn't)
>
> Both lines of code works perfectly as expected in FF3 (haven't tried 2
> yet) and Safari 4 (accordion bit jerky on it like on ie)
> http://codeserenity.com/jquery/scriptless/demo4.html - for demo - code
> same as above but 4, working on it so might not always work :p
>
> So my guess is join() and += in IE don't work the same. I don't know
> why the code variable becomes blank tho. The only silly thing I think
> of is maybe the return of eval is ''. My only worry is that if I can
> make it not blank I'll just get the error again.
>
> Oh, and only tried on IE7 so far as well for the bug, not IE6 or IE8.
>
>
>
> On Mar 27, 5:18 pm, Gilles <[email protected]> wrote:
>
>> Thanks for that great tip, I'll try to keep that in mind :)
>>
>> On Mar 27, 3:21 pm, Tony Dillon <[email protected]> wrote:
>>
>>
>>> Hi Karl,
>>> Boy, these sure are some of the hardest problems to track down.... This is
>>> why I always try to do my comparisons using the format:
>>>
>>> if( 'constant' == $variable )
>>>
>>> so it gets picked up as an error by the compiler (because of course you
>>> can't assign a variable to a string constant).
>>>
>>> Hope this helps you avoid future problems.
>>>
>>> Be well,
>>> Tony
>>>
>>> On Fri, Mar 27, 2009 at 3:09 PM, Gilles <[email protected]> wrote:
>>>
>>>> Thanks for pointing it out Karl, will go fix that now, can't believe I
>>>> type that wrong.
>>>>
>>>> Karl Swedberg wrote:
>>>>
>>>>> Hi Gilles,
>>>>>
>>>>> Not sure about that bug, but wondering if these lines are
>>>>> intentionally assigning the variable rather than testing for equality :
>>>>>
>>>>> if (d = 'ui') js.push('ui.'+cw); // line 151
>>>>> else if (d = 'fx') js.push('effects.'+cw); // line
>>>>>
>>>> 152
>>>>
>>>>> if (d = 'ui') css.push('ui.'+cw); // line 156
>>>>>
>>>>> seems they should have == rather than = .
>>>>>
>>>>> --Karl
>>>>>
>>>>> ____________
>>>>> Karl Swedberg
>>>>> www.englishrules.com
>>>>> www.learningjquery.com
>>>>>
>>>>> On Mar 27, 2009, at 5:06 AM, Gilles wrote:
>>>>>
>>>>>> Not sure wether it would help or not but here full plugin code.
>>>>>>
>>>>>> http://codeserenity.com/jquery/scriptless/js/jquery.scriptless3.js
>>>>>>
>>>>>> If anyone know how I could get rid off that "Object doesn't support
>>>>>> property" bug on IE I would really appreciate. Any advices and/or tips
>>>>>> on how to improve it would be welcome as well, still learning :)
>>>>>>
>>>>>> On Mar 26, 12:23 pm, John Resig <[email protected]> wrote:
>>>>>>
>>>>>>> I'm not seeing an issue off-hand - could you simplify the code that
>>>>>>> you're trying to execute? For example, does this error only occur if
>>>>>>> getScript is used?
>>>>>>>
>>>>>>> --John
>>>>>>>
>>>>>>> On Thu, Mar 26, 2009 at 7:15 AM, Gilles <[email protected]> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I normally bebug my code myself, cos I believe it helps me improve
>>>>>>>> myself, but here I just can't figure it out.
>>>>>>>>
>>>>>>>> basically I am writing a JQuery plugin, that JQuery plugin
>>>>>>>> generate a
>>>>>>>> bit of code that I then eval later. The code is a casacde of
>>>>>>>> getScript
>>>>>>>> with some initialization command being trigger in the middle (when
>>>>>>>> all
>>>>>>>> the getScript are finished)
>>>>>>>>
>>>>>>>> To make my life easy I thought I use $.globalEval(code) to make sure
>>>>>>>> it works accross all browsers. Like expected no issue with safari 3,
>>>>>>>> safari 4, FF2 or FF3 but as soon as i tried my test page on IE7
>>>>>>>> everything broke...
>>>>>>>>
>>>>>>>> And of course I get the well know and very easy to debug error
>>>>>>>> 80020101.
>>>>>>>>
>>>>>>>> 1. It's not because of comment (none used anywhere)
>>>>>>>> 2. I have tried:
>>>>>>>>
>>>>>>>> eval(code)
>>>>>>>> eval(code,$)
>>>>>>>> window.eval(code)
>>>>>>>> execScript(code)
>>>>>>>> window.execScript(code)
>>>>>>>> window['code'] = code; window.eval(window['code'])
>>>>>>>> window['code'] = code; eval(window['code'])
>>>>>>>> window['code'] = code; window.execScript(window['code'])
>>>>>>>> window['code'] = code; execScript(window['code'])
>>>>>>>> and many other approach I fund during my search (window.eval ||
>>>>>>>> eval)
>>>>>>>> (code.... try {} catch {} etc....
>>>>>>>>
>>>>>>>> (debugging IE so tried any stupid way I could think off too which
>>>>>>>> would explain some of the non-valid example above, I was desperate
>>>>>>>> lol)
>>>>>>>>
>>>>>>>> 3. I have checked and checked the code I am trying to eval and I
>>>>>>>> just
>>>>>>>> don't get it, I am pretty sure it's not a JQuery bug of course,
>>>>>>>> but as
>>>>>>>> I am trying to do this via JQuery it give me an excuse to come and
>>>>>>>> ask
>>>>>>>> the JQuery community and team where the best javascript developers
>>>>>>>> are! (kissing asses sometimes help :p)
>>>>>>>>
>>>>>>>> Here is the code I am trying to eval:
>>>>>>>>
>>>>>>>> Unformatted (I tried sending it using return carriage, compressed,
>>>>>>>> with space none of them works)
>>>>>>>>
>>>>>>>> $.getScript('js/ui.core.js',function(){
>>>>>>>> $.getScript('js/ui.dialog.js',function(){
>>>>>>>> $.getScript('js/ui.tabs.js',function(){
>>>>>>>> $.getScript('js/ui.datepicker.js',function(){
>>>>>>>> $.getScript('js/
>>>>>>>> ui.resizable.js',function(){
>>>>>>>> $.getScript('js/
>>>>>>>> ui.accordion.js',function(){
>>>>>>>> $
>>>>>>>> ('#foo1').dialog({ bgiframe: true, height: 140, modal:
>>>>>>>> true });
>>>>>>>> $
>>>>>>>> ('#foo2').tabs({}); $('#date1').datepicker({altField: '#alt',
>>>>>>>> altFormat: 'DD, d MM, yy'});
>>>>>>>> $
>>>>>>>> ('#foo3').resizable({ maxHeight: 280, maxWidth: 440, minHeight:
>>>>>>>> 155, minWidth: 200 });
>>>>>>>> $
>>>>>>>> ('#foo4').accordion({ icons: { 'header': 'ui-icon-plus',
>>>>>>>> 'headerSelected': 'ui-icon-minus' } });
>>>>>>>> });
>>>>>>>> });
>>>>>>>> });
>>>>>>>> });
>>>>>>>> });
>>>>>>>> });
>>>>>>>>
>>>>>>>> 4. One last thing that is weird, also nothing and nothing at all
>>>>>>>> change sometimes it return an object doesn't support this property
>>>>>>>> error instead....
>>>>>>>>
>>>>>>>> Here is the code building the code to eval:
>>>>>>>>
>>>>>>>> // Start creating the code to be eval at the end ( we cascade
>>>>>>>> getScript)
>>>>>>>> for (i = 0; i < jsl; i++) code += '$.getScript(\''+file[i]+'.js
>>>>>>>> \',function(){';
>>>>>>>>
>>>>>>>> // Add our init functions (we are inside the callback function of
>>>>>>>> the
>>>>>>>> last getScript)
>>>>>>>> if (init.length > 0) code += init.join('; ')+';';
>>>>>>>>
>>>>>>>> // Close all our getScripts
>>>>>>>> for (i = 0; i < jsl; i++) code += '});';
>>>>>>>>
>>>>>>>> then just
>>>>>>>>
>>>>>>>> $.globalEval(code);
>>>>>>>>
>>>>>>>> to call it (used to test for ie, but got nothing that work with
>>>>>>>> it, so
>>>>>>>> no real point until I can debug the issue.
>>>>>>>>
>>>>>>>> If anyone can help please let me know I will really appreciate.
>>>>>>>>
>>>>>>>> Thanks in advance.
>>>>>>>>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---