[jQuery] Re: Very disappointed with jquery and iframe communication
this should work: $(frames['Theiframe']).attr('src', new_page_url); On Tue, Sep 15, 2009 at 4:45 PM, ximo wallas wrote: > > How can I tell to the iframe to load() a different content from the main > document? > > --- On Tue, 9/15/09, Paolo Chiodi wrote: > > From: Paolo Chiodi > Subject: [jQuery] Re: Very disappointed with jquery and iframe communication > To: jquery-en@googlegroups.com > Date: Tuesday, September 15, 2009, 1:42 PM > > > Of course it doesn't work. > You are searching for node elements with id=login that are child of > your iframes. You need to use the dom of the page loaded inside the i > frame > try $(frames['Theiframe']).get(0).contentDocument > > I in the content page is present jquery, use > $(frames['Theiframe']).get(0).contentWindow.$('#login') > > BTW, you can access child dom only if in same domain > > Paolo > > On Tue, Sep 15, 2009 at 10:53 AM, ximo wallas wrote: > > > > After 1 day googling and trying I find no agreement in a solid method for > > comunicating with iframe, this is the nearest point I've been to get in > > touch with IFRAME: > > > > $(frames['Theiframe']).ready( function () > > { > > alert('Frame is loaded'); > > > > }); > > > > This will alert the message, but any attempt to comunicate with the iframe > > and access it's contents have been useless, I have a hidden field with with > > ID "login" and I'm trying to get it's value: > > > > $(frames['Theiframe']).find("#login").val(); //Doesn't work in FF 3.0.14 > > > > / > > > > var $currentIFrame = $(frames['Theiframe']); > > $currentIFrame.contents().find("body #login").val() //Neither does in FF > > 3.0.14 > > > > If you Google a few you will see that everyone is giving it's own opinion > > on how to do it, but there's no agreement and no crossbrowser solid > > solution... > > > > >
[jQuery] Re: Very disappointed with jquery and iframe communication
Of course it doesn't work. You are searching for node elements with id=login that are child of your iframes. You need to use the dom of the page loaded inside the i frame try $(frames['Theiframe']).get(0).contentDocument I in the content page is present jquery, use $(frames['Theiframe']).get(0).contentWindow.$('#login') BTW, you can access child dom only if in same domain Paolo On Tue, Sep 15, 2009 at 10:53 AM, ximo wallas wrote: > > After 1 day googling and trying I find no agreement in a solid method for > comunicating with iframe, this is the nearest point I've been to get in touch > with IFRAME: > > $(frames['Theiframe']).ready( function () > { > alert('Frame is loaded'); > > }); > > This will alert the message, but any attempt to comunicate with the iframe > and access it's contents have been useless, I have a hidden field with with > ID "login" and I'm trying to get it's value: > > $(frames['Theiframe']).find("#login").val(); //Doesn't work in FF 3.0.14 > > / > > var $currentIFrame = $(frames['Theiframe']); > $currentIFrame.contents().find("body #login").val() //Neither does in FF > 3.0.14 > > If you Google a few you will see that everyone is giving it's own opinion on > how to do it, but there's no agreement and no crossbrowser solid solution... > >
[jQuery] Re: AJAX: process the response XML
maybe: $(data).find('#xyz title').text(); On Fri, Aug 28, 2009 at 7:44 PM, jeanluca wrote: > > Hi All > > I'm truggling with this for a while now, without succes. Here is the > test code: > > $.ajax({ > type: "GET", > url: url, > cache: false, > dataType: 'xml', > async: true, > complete: function(data, status) { > // get title name of the book element with id 'xyz' > } > }) ; > > suppose the xml send from the server is > > > > > Some Title > > > Other title > > > > So my question is: How do I get the title from the book element with > id 'xyz' > I've tried to parse data.responseXML or something like > > var d = $(data) ; > d.find('#xyz').each(function() { ... }) ; > > It would be great if I could do something like: > > alert("TITLE IS " + $("#xyz", data.responseXML).text() ); > > Any suggestions ? > or maybe these a plugin that can help? > > thnx a lot
[jQuery] Re: window.open
To open a window you must use window.open. With jquery you have a better way to add the event handler. $('a').click(function(ev){ window.open('/plans/individual/continue-to-ap-pop.asp', 'Continue_to_Application','width=200,height=400'); ev.preventDefault(); return false; }) Paolo On Fri, Aug 28, 2009 at 7:59 PM, Luh Hooo Zer wrote: > > is there a nicer way to open a sized window using jquery other than > this: > >
[jQuery] Re: not able to append new tag in XML in IE
Sound strange to me. $({your selector}) should acces the html dom document, not the xml document. And what is the xmlData variable? You can youse createElement if it is the xml dom document, not if it is a jqery object On Fri, Aug 28, 2009 at 7:59 AM, g...@iec wrote: > > Hi Paolo, > > Thanks for your suggestion but this still not work. > But i find a solution and it should be done as mentioned below: > > var new_ele = xmlData.createElement('new_ele_name'); > $(new_ele).text({value which you want to put inside tag}); > $({your selector}).append(new_ele); > > And this work both in ie and ff. > > On Aug 26, 11:24 pm, Paolo Chiodi wrote: >> Maybe not the best solution, but here's something that work: >> >> var new_element = xmlData.get(0).createElement('new_element_name'); >> xmlData.find('your_query').append(new_element); >> >> On Wed, Aug 26, 2009 at 1:49 PM, g...@iec wrote: >> >> > In ajax call, i set dataType as 'xml' and on success, i call a >> > function in which i am passing xml which i got as response. >> > And in the function i a assigning that data to a global variable so >> > that i can access it from any function. >> > I am assigning it to a global variable as shown below : >> > xyz : function(data){ >> > xmlData = $(data); >> > . >> > >> > } >> > like this and then i need to modify xmldata if there is any change in >> > form and on submit of form, i am sending xmlData back to server using >> > ajax call. >> >> > So please guide me accordingly to modify xml in global variable on >> > change in form data from any other function. >> >> > On Aug 26, 3:47 pm, Paolo Chiodi wrote: >> >> You don't have to use xmlData, which is the jquery object, but data >> >> which is the xml dom (if you set xml as type of the request) >> >> >> Paolo >> >> >> On Wed, Aug 26, 2009 at 12:35 PM, g...@iec wrote: >> >> >> > Thanks for your reply. >> >> > But this is not working.The data which i got as a result from ajax >> >> > call on success, i stored it in a global variable. >> >> > Like this >> >> > var xmlData = $(data); >> >> > But when i was executing like you told, it is not creating an >> >> > element. >> >> >> > On Aug 26, 1:49 pm, Paolo Chiodi wrote: >> >> >> when you do document.createElement you create an element that is child >> >> >> of "document" document. >> >> >> Try to create the element with data.createElement. >> >> >> >> Paolo >> >> >> >> On Wed, Aug 26, 2009 at 10:14 AM, g...@iec >> >> >> wrote: >> >> >> >> > I am making an ajax call and in response, i am getting an XML. >> >> >> > And then using data from XML, i am creating a form. >> >> >> > I stored response XMl in a variable like this >> >> >> > var xmlData = $(data); >> >> >> > If there is any change in any field of form then i am changing >> >> >> > corresponding node value in xmlData >> >> >> > by appending new node in related node like this : >> >> >> > var val = document.createElement('{nodename}'); >> >> >> > $(val).text({changed value}); >> >> >> > $({corresponding node}).append($(val)); >> >> >> >> > This is working fine in FF but not working in IE. >> >> >> >> > Kindly guide me how can i solve this problem. >> >> >> >> > Thanks in advance to all for providing guidance.
[jQuery] Re: Hover does not stop
maybe the hover is generated more than once while it is sliding. I would try to add a callback on animation end, setting tha state of the menu: open or closed. then on mouse over animate only if open, on mouse out close only if closed On Fri, Aug 28, 2009 at 12:01 PM, Mario wrote: > > Toggle works fine. But the problem now is that I always have to click > and I wanted the menu ot appear and disappear onmouseover/mouseout.
[jQuery] Re: input color - default color
try $('#first_input').css('background-color', null) On Fri, Aug 28, 2009 at 12:23 PM, dziobacz wrote: > > I have inputs with validationin in jquery. If data are wrong I make > red background color in input: > $('#first_input').css('background-color', 'red'); > > After click reset I would like to see default input color so I make: > $('#first_input').css('background-color', 'white'); > > But inputs with background-cloror: white looks different than default > inputs - why ?
[jQuery] Re: Image inside script
you should do prepend(...) after html(...). Doing html you replace all the inner html of the $('.' + errId). What you do here is to appen the image and then removing it by changing the html. The image will be displayed as the first element although you put prepend as last operation: prepend automatically insert the element as the first child (opposite of append that insert the element as the last) On Thu, Aug 27, 2009 at 8:02 AM, Fabio wrote: > > Hi Paolo , > > I Tried perpending > > like this > > > var errImg = '/img/errIcon.gif'; > > $("."+errId).attr("style","display: inline; color: red");$ > ("."+errId).prepend(' ');$ > ("."+errId).html(' Invalid Character. Numerals only.');} > > which should have worked like a magic.. but unfortuneltly something > is causing the image not to render ... could u please help me figure > out the issue > > the image is placed under the web content/themes/img/errorIcon.gif > > Thanks > Fabio > > > > > ' ' > On Aug 27, 10:05 am, Fabio wrote: >> Hi Paolo , >> >> I tried doing this >> >> {$("."+errId).attr("style","display: inline; color: red");$ >> ("."+errId).html("> >> > Invalid Character. Numerals only.");} >> >> since the image is not picking up from the /img/ folder i am >> trying to access with a help of the context path .Or is there a work >> around for this . >> >> early reply would be appreciated. >> >> Thanks >> Fabio >> >> On Aug 26, 11:29 pm, Paolo Chiodi wrote: >> >> >> >> > $("."+errId).prepend(''); >> >> > On Wed, Aug 26, 2009 at 5:45 AM, Fabio wrote: >> > > $("."+errId)
[jQuery] Re: jQuery .append all elements
$(document).ready(function(){ img=$(".img"); img.each(function(i){ var imga = $(this).attr("href"); $("#imgbox").append(""); }); }); Paolo On Thu, Aug 27, 2009 at 4:08 AM, Jottae wrote: > $(document).ready(function(){ > img=$(".img"); > imga=img.attr("href"); > $("#imgbox").append(">"); > > });
[jQuery] Re: LavaLamp SubMenu Help!
quite simple. instead of setting the color to green in the :active class, just use jquery.hover to set the color. Maybe when you hover the submenu you set yhe color, when exit the submenu set the color to default Paolo On Thu, Aug 27, 2009 at 2:52 PM, Karen Morales wrote: > Hi > > I would like someone to help me out with some issues I am having with the > Lava Lamp / SubMenu. > > This is what I have achieved so far http://karen.2kmegs.com, however what I > am trying to do now is that when I am hovering the 'Home' (or whichever has > a submenu) I would like the text to remain Green, because as it is now, once > I go on the submenu, it turns white again > > Also, is there like a way to fade the colour transitionally from like 'Home' > to 'HTML' rather than change it at once, so that once the LavaLamp image > goes on the hovered text it will sort of Fade to the green colour, because > as it is now, the text changes green before the Image hovers over the text, > and I dont want to increase the speed of the image moving > > I would gladly appreciate all the help given! > > Thanks
[jQuery] Re: not able to append new tag in XML in IE
Maybe not the best solution, but here's something that work: var new_element = xmlData.get(0).createElement('new_element_name'); xmlData.find('your_query').append(new_element); On Wed, Aug 26, 2009 at 1:49 PM, g...@iec wrote: > > In ajax call, i set dataType as 'xml' and on success, i call a > function in which i am passing xml which i got as response. > And in the function i a assigning that data to a global variable so > that i can access it from any function. > I am assigning it to a global variable as shown below : > xyz : function(data){ > xmlData = $(data); > . > > } > like this and then i need to modify xmldata if there is any change in > form and on submit of form, i am sending xmlData back to server using > ajax call. > > So please guide me accordingly to modify xml in global variable on > change in form data from any other function. > > On Aug 26, 3:47 pm, Paolo Chiodi wrote: >> You don't have to use xmlData, which is the jquery object, but data >> which is the xml dom (if you set xml as type of the request) >> >> Paolo >> >> On Wed, Aug 26, 2009 at 12:35 PM, g...@iec wrote: >> >> > Thanks for your reply. >> > But this is not working.The data which i got as a result from ajax >> > call on success, i stored it in a global variable. >> > Like this >> > var xmlData = $(data); >> > But when i was executing like you told, it is not creating an >> > element. >> >> > On Aug 26, 1:49 pm, Paolo Chiodi wrote: >> >> when you do document.createElement you create an element that is child >> >> of "document" document. >> >> Try to create the element with data.createElement. >> >> >> Paolo >> >> >> On Wed, Aug 26, 2009 at 10:14 AM, g...@iec wrote: >> >> >> > I am making an ajax call and in response, i am getting an XML. >> >> > And then using data from XML, i am creating a form. >> >> > I stored response XMl in a variable like this >> >> > var xmlData = $(data); >> >> > If there is any change in any field of form then i am changing >> >> > corresponding node value in xmlData >> >> > by appending new node in related node like this : >> >> > var val = document.createElement('{nodename}'); >> >> > $(val).text({changed value}); >> >> > $({corresponding node}).append($(val)); >> >> >> > This is working fine in FF but not working in IE. >> >> >> > Kindly guide me how can i solve this problem. >> >> >> > Thanks in advance to all for providing guidance.
[jQuery] Re: Image inside script
$("."+errId).prepend(''); On Wed, Aug 26, 2009 at 5:45 AM, Fabio wrote: > $("."+errId)
[jQuery] Re: Quick question, basic stuff
one way could be $('div.pic:eq(1)').find('ul li a:eq(2)) Paolo On Wed, Aug 26, 2009 at 12:17 PM, Bart wrote: > > Hi all, > > In a HTML document I'm having a few divs with the same class. In each > of this divs is nested an unordered list with inside the list items > some anchors. I'm trying to find a certain jquery expression which > says I want link#3 from div#2. I've tried; > > $("div.pic:eq(1) ul li a:eq(2)").hide(); > > which doesn't seem to work... I think because you can't have :eq() > twice as selector. How would I make this work?
[jQuery] Re: not able to append new tag in XML in IE
You don't have to use xmlData, which is the jquery object, but data which is the xml dom (if you set xml as type of the request) Paolo On Wed, Aug 26, 2009 at 12:35 PM, g...@iec wrote: > > Thanks for your reply. > But this is not working.The data which i got as a result from ajax > call on success, i stored it in a global variable. > Like this > var xmlData = $(data); > But when i was executing like you told, it is not creating an > element. > > On Aug 26, 1:49 pm, Paolo Chiodi wrote: >> when you do document.createElement you create an element that is child >> of "document" document. >> Try to create the element with data.createElement. >> >> Paolo >> >> On Wed, Aug 26, 2009 at 10:14 AM, g...@iec wrote: >> >> > I am making an ajax call and in response, i am getting an XML. >> > And then using data from XML, i am creating a form. >> > I stored response XMl in a variable like this >> > var xmlData = $(data); >> > If there is any change in any field of form then i am changing >> > corresponding node value in xmlData >> > by appending new node in related node like this : >> > var val = document.createElement('{nodename}'); >> > $(val).text({changed value}); >> > $({corresponding node}).append($(val)); >> >> > This is working fine in FF but not working in IE. >> >> > Kindly guide me how can i solve this problem. >> >> > Thanks in advance to all for providing guidance.
[jQuery] Re: jQuery selector for style attribute
Maybe that that the style attribute value should be exactly equal to the one contained in html. I think style="A:B C:D" doesn't match style="C:D A:B". May also be that the browser has an internal rapresentation of the style attribute slightly different from the one written in the html (never tried to see with firebug some differen orders?). Otherwise if you create the style attribute by using .css('A','B'), you can't be sure of what the entire style attribute could be. Paolo On Tue, Aug 25, 2009 at 11:22 PM, John wrote: > > Thanks Maurício for your quick response. > > I have a program to automatically generate jQuery selectors based on > some UI element attributes and seems your syntax is not always > working. For example, > > 1) working: $('div:has(input[type=text][readonly=true], img > [style="overflow: auto; width: 356px; height: 100px;"]) img') > > 2) Not working: $('div:has(input[type=text][readonly=true] > [style="width: 343px;"], img[style="overflow: auto; width: 356px; > height: 100px;"]) img') > > 3) Not working: $('div:has(input[type=text][readonly=true], img > [style="overflow: auto; width: 356px; height: 100px;"]) img > [style="overflow: auto; width: 356px; height: 100px;"]') > > 4) Not working: $('div:has(input[type=text][readonly=true] > [style="width: 343px;"], img[style="overflow: auto; width: 356px; > height: 100px;"]) img[style="overflow: auto; width: 356px; height: > 100px;"]') > > Here "not working" means it returns empty object where it should > return non-empty object. > > Do you know what is wrong? > > Thanks again, > > John > > On Aug 25, 2:50 pm, "Mauricio \(Maujor\) Samy Silva" > wrote: >> Sintax for the selector is: >> >> $('img[style="overflow: auto; width: 356px; height: 100px;"]') >> >> Maurício >> -Mensagem Original- >> De: John >> Para: jQuery (English) >> Enviada em: terça-feira, 25 de agosto de 2009 14:36 >> Assunto: [jQuery] jQuery selector for style attribute >> >> Hi, >> >> I want to select the following image using jQuery selector to see if I >> could use the style attribute, >> >> > style="overflow: auto; width: 356px; height: 100px;" src="images/ >> s.gif"/> >> >> but seems the selector >> >> img[style=overflow: auto; width: 356px; height: 100px;] >> >> does not work at all. What would be the correct selector for the style >> attribute? >> >> Thanks in advance, >> >> John
[jQuery] Re: Dynamically Created anchor tags
live is no longer a plugin, but core of jquery Paolo On Wed, Aug 26, 2009 at 10:14 AM, Leonard Martin wrote: > > You will either need to use the live plugin as follows: > > $('#thumbs a').live('click',function(){...}); > > Or move the binding of your 'click' inside the callback function of > your $.ajax call so it would then look like: > > .appendTo('#thumbs').click(function(){...}); > > As it is you're trying to bind onto anchors which don't exist yet. > Using $().live() allows you to bind onto all exisiting elements, and > any elements which may be created in the future. > > > > On Aug 26, 8:54 am, cachobong wrote: >> Hello! I need help on this. i created image links by reading an xml >> and creating the img and a tags in jquery. how do i put a function in >> it? i tried the function below but it doesnt seem to work. These image >> links are stored in the div: "thumbs" >> >> Below is the code: >> >> $(function() { >> $("#thumbs a").click(function(event) { >> event.preventDefault(); >> alert("Hello world!"); >> }); >> >> $.ajax({ >> type: "GET", >> url: "thumbs.xml", >> dataType: "xml", >> success: function(xml) { >> $(xml).find('thumb').each(function(){ >> var title_text = $(this).find('title').text(); >> var path_text = $(this).find('path').text(); >> >> $('').html('') >> .appendTo('#thumbs'); >> }); //close each( >> } >> }); //close $.ajax( >> >> }); //close $( >> >> Thank you!!
[jQuery] Re: not able to append new tag in XML in IE
when you do document.createElement you create an element that is child of "document" document. Try to create the element with data.createElement. Paolo On Wed, Aug 26, 2009 at 10:14 AM, g...@iec wrote: > > I am making an ajax call and in response, i am getting an XML. > And then using data from XML, i am creating a form. > I stored response XMl in a variable like this > var xmlData = $(data); > If there is any change in any field of form then i am changing > corresponding node value in xmlData > by appending new node in related node like this : > var val = document.createElement('{nodename}'); > $(val).text({changed value}); > $({corresponding node}).append($(val)); > > This is working fine in FF but not working in IE. > > Kindly guide me how can i solve this problem. > > Thanks in advance to all for providing guidance. >
[jQuery] Re: Get the input value of "ANY" element tag
Another way is to alert($(this).find("#property_links").size()) to see how many dom elements you get with that selector Have you tried to use firebug to see the value of the hidden inputs? maybe also that the error was server side... Paolo On Tue, Aug 25, 2009 at 8:09 PM, Paolo Chiodi wrote: > What kind of error have you now? Have you tried to do alert(prop) to > see if the value is correct? > > Paolo > > On Tue, Aug 25, 2009 at 5:49 PM, ArySal wrote: >> >> Hi Paolo, >> >> Thanks for the advice. >> >> I tried what you mentioned still it does not work, the error is >> slightly different but the result is pretty much the same. >> >> What do you mean "By the way, it is not reccomanded to have more then >> one element with same id ", could you recommend a tutorial or pointers >> where I can get this function working please >> >> Thanks Ary >> >
[jQuery] Re: Get the input value of "ANY" element tag
What kind of error have you now? Have you tried to do alert(prop) to see if the value is correct? Paolo On Tue, Aug 25, 2009 at 5:49 PM, ArySal wrote: > > Hi Paolo, > > Thanks for the advice. > > I tried what you mentioned still it does not work, the error is > slightly different but the result is pretty much the same. > > What do you mean "By the way, it is not reccomanded to have more then > one element with same id ", could you recommend a tutorial or pointers > where I can get this function working please > > Thanks Ary >
[jQuery] Re: Get the input value of "ANY" element tag
Your code don't work because with $("#property_links") you retreive every hidden input with that id, then val() return value only for the first. You have to access only the correct hidden input: you can use a find that search for a query in all the children of the clicked p You have to replace var prop = $("#property_links").val(); with var prop = $(this).find("#property_links").val(); By the way, it is not reccomanded to have more then one element with same id Paolo On Tue, Aug 25, 2009 at 3:30 PM, arysal...@hotmail.com wrote: > > Hi Guys, > > I am having difficulty getting the value of a specific value contained > in a tag. What is happening is that it retrieves the value of the > first tag value and not the on the user clicks. > > What I need is to retieve the value from the tag the user click. > > Snippet code [BEGIN]: > > $(document).ready(function() { > > $("p").click(function () { > var prop = $("#property_links").val(); > $.post("n10-shortlist-connector.html", { web_AGENT_REF: prop}); > var htmlStr = "Added to Compare Tool"; > $(this).text(htmlStr); > }); > > }); > > > Add to Compare Tool type="hidden" id="property_links" value=""/> a> // many of these tags on the page > > Snippet code [END]: > > view page: http://nwbeta.itproz.co.uk/residenti...tion=Liverpool > If viewing the site when you click "add to compare list" it will > change to "Added to compare list" > > All help appreciated, > Thanks in advance. >