[Mapbender-dev] using jquery ...

Christoph Baudson (WhereGroup) christoph.baudson at wheregroup.com
Tue May 15 08:43:22 EDT 2007


Hi Michael,

I tried a jQuery function instead:

$("div.listitem", parent.frames["digitize"].document).hide("slow");

This works for me now! But this one

$("div.listitem", parent.frames["digitize"].document).Draggable({ ...

is still a mystery to me.

Do you have the latest version of jQuery?

Cheers

Christoph


Michael Schulz schrieb:
> Hi Christoph,
> 
> i tried that approach too (fully referencing both iframes from the
> top), but this is exactly the error message i get all the time...
> Happens similar with the $(document).ready() thing, that is pure
> jQuery no extensions.
> 
> Michael
> 
> 2007/5/15, Christoph Baudson (WhereGroup) 
> <christoph.baudson at wheregroup.com>:
>> Here's what I tried
>>
>> $("div.listitem", parent.frames["digitize"].document).Draggable({ ...
>>
>> where
>>
>> $ = parent.frames['ajax'].window.$;
>>
>> When I log through jQuery it seems like it works. I get an object
>> [Object HTMLDivElement] as a result of the "find" method.
>>
>> But then the script halts and Firebug says
>>
>> this.setArray() is not defined
>>
>> Maybe that is due to the Draggable, which is a jQuery extension.
>>
>> I will continue trying
>>
>> Christoph
>>
>>
>> Michael Schulz schrieb:
>> > Hi Christoph, Marc,
>> >
>> > yes, I tried it, but to no avail. Here's a test code snippet:
>> >
>> > -------------------------------------
>> > <html><head>
>> > <script type="text/javascript">
>> >
>> > i_$ = top.frames["ajax"].window.jQuery;
>> >
>> > i_$(document).ready(function() {
>> >        i_$("a",document).background("#f00");
>> > });
>> >
>> > </script>
>> > </head>
>> > <body>
>> > <h1>MapBender jQuery Test page</h1>
>> > <a href="http://www.jquery.com">The jQuery library.</a>
>> > </body>
>> > ------------------------------------------------------
>> >
>> > INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment,
>> > e_element, e_src, e_attributes, e_left, e_top, e_width, e_height,
>> > e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod,
>> > e_target, e_requires, e_url) VALUES('gui1','test_jquery',10,1,'test
>> > 
>> jquery','iframe','../frames/mod_testjquery.html','frameborder="1"',980,25,250,200,NULL 
>>
>> >
>> > ,'visibility:visible;','','iframe','','','','','');
>> >
>> > Yep, I too think, the jquery mailing list is the next step.
>> >
>> > Cheers, Michael
>> >
>> >
>> > 2007/5/15, Christoph Baudson (WhereGroup)
>> > <christoph.baudson at wheregroup.com>:
>> >> Did you already try the context parameter Marc mentioned?
>> >>
>> >> imported_$('div.test a', document);
>> >>
>> >> I haven't given this subject enough time for a final conclusion; maybe
>> >> we should contact the jQuery mailing list?
>> >>
>> >> Thanks for sharing
>> >>
>> >> Christoph
>> >>
>> >> Michael Schulz schrieb:
>> >> > Hi,
>> >> >
>> >> > I've been fiddling around with this subject, and I think 
>> Christoph is
>> >> > right. jQuery has to be loaded in that frame you want to use it. You
>> >> > can then from that frame, reference elements in another frame and
>> >> > manipulate them. Not the other way round.
>> >> >
>> >> > Cheers, Michael
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > 2007/5/14, Marc Jansen <jansen.marc at gmx.de>:
>> >> >> Christoph Baudson (WhereGroup) schrieb:
>> >> >> > I would be very interested in a solution. I use the jQuery
>> >> library in
>> >> >> > a separate frame, but want to locate html elements in another
>> >> iframe.
>> >> >> >
>> >> >> > Until now I didn't succeed. In this example
>> >> >> >
>> >> >> > > imported_$('div.test a').find('span').each(function(i) { ...
>> >> >> >
>> >> >> > the variable imported_$ only *points* to the jQuery library in 
>> the
>> >> >> > remote frame, so 'div.test a' will only find the div tags in the
>> >> >> > iframe where jQuery is loaded, and not in the intended iframe. At
>> >> >> > least that is my interpretation ;-)
>> >> >>
>> >> >> Yepp, this might be true. yet one can pass over a context to search
>> >> >> within to the func:
>> >> >> imported_$('div.test a', document);
>> >> >> _______________________________________________
>> >> >> Mapbender_dev mailing list
>> >> >> Mapbender_dev at lists.osgeo.org
>> >> >> http://lists.osgeo.org/mailman/listinfo/mapbender_dev
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >> --
>> >> Baudson Christoph
>> >> http://www.wheregroup.com
>> >> _______________________________________________
>> >> Mapbender_dev mailing list
>> >> Mapbender_dev at lists.osgeo.org
>> >> http://lists.osgeo.org/mailman/listinfo/mapbender_dev
>> >>
>> >
>> >
>>
>>
>> -- 
>> Baudson Christoph
>> http://www.wheregroup.com
>> _______________________________________________
>> Mapbender_dev mailing list
>> Mapbender_dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapbender_dev
>>
> 
> 


--
Baudson Christoph
http://www.wheregroup.com


More information about the Mapbender_dev mailing list