forgive me if I'm wrong but I thought that jquery had onload or load
functions that detec when an element or document is finished loading? I
tried without success maybe I'm misinformed. I would never go into jquery's
innards ;)


William-118 wrote:
> 
> 
> I doubt mucking about in the jQuery innards to change the behaviour of
> when the ready or load events fire will be easier than re-arranging
> your scripts so that setParam is defined before you call it...
> 
> On Jan 28, 2:28 pm, RR_QQ <rquiu...@leasethis.com> wrote:
>> I understand. However is there another option? How about with jquery
>> allowing
>> the object id containing the flash to finish loading before that code
>> gets
>> executed? How can I do that? That's probably easier but I am new to
>> jquery
>> and I just don't know how to do that!
>>
>>
>>
>> William-118 wrote:
>>
>> > Well, I agree with the browser... DOMElement.setParam() is not a
>> > function. You might have another script in your page that is
>> > overloading the prototype to define a setParam function, which would
>> > explain the alert() behaviour. Scripts are always executed in document
>> > order, so your script snippet above will run, and then alert() will
>> > cause that scripts execution to halt, which will allow the other
>> > scripts to get their pending work done.
>>
>> > Potential solutions:
>> > 1) put your scripts in the correct order
>> > 2) fake it, by delaying the execution of your setParam, hopefully long
>> > enough so that your other scripts can do their business:
>>
>> > $(function () {
>> >   setTimeout(function () {
>> >     document.getElementById('ip_details_graph').setParam
>> > ('values.value.max','100');
>> >   },500);
>> > });
>>
>> > I would recommend solution #1. You will need to figure out what the
>> > correct ordering is.
>>
>> > On Jan 28, 1:28 pm, RR_QQ <rquiu...@leasethis.com> wrote:
>> >> Ok so I am using amcharts and I am trying to change a setting
>> >> dynamically.
>> >> The following codes (when placed at the top of the document) works
>> >> PERFECTLY:
>>
>> >> $(window).load(function() {
>> >>         alert('TEST');
>> >>        
>> >>
>> document.getElementById('ip_details_graph').setParam('values.value.max',
>> >> '100');
>>
>> >> });
>>
>> >> HOWEVER when I comment out the 'alert':
>>
>> >> $(window).load(function() {
>> >>         //alert('TEST');
>> >>        
>> >>
>> document.getElementById('ip_details_graph').setParam('values.value.max',
>> >> '100');
>>
>> >> });
>>
>> >> Not only does the setting change NOT take place I also get this:
>>
>> >> document.getElementById('ip_details_graph').setParam is not a function
>>
>> >> WHAT GIVES!? I need to run that code after the amchart has finished
>> >> loading
>> >> but I just not sure how to do that! Maybe thats what the problem is.
>> The
>> >> ID
>> >> of the SWF object is 'ip_details_graph'
>>
>> >> THANKS!!
>> >> --
>> >> View this message in
>> >>
>> context:http://www.nabble.com/Jquery-call-works-with-%27alert%27-but-no-if-i-...
>> >> Sent from the jQuery General Discussion mailing list archive at
>> >> Nabble.com.
>>
>> --
>> View this message in
>> context:http://www.nabble.com/Jquery-call-works-with-%27alert%27-but-no-if-i-...
>> Sent from the jQuery General Discussion mailing list archive at
>> Nabble.com.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Jquery-call-works-with-%27alert%27-but-no-if-i-comment-%27alert%27-out%21-tp21715465s27240p21716898.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to