How to attach resize event to top window from iframe?
Hi Guys, I would like to attach resize event to top window(main.html) when iframe(sub.html) ready.but seems it doesn't work,please see below code : i dont know why it does not work,please,who could correct me ? or give me some suggestion on it? i will appreciate it. $(window.top.document).ready(function(){ $(window.top).resize(function(){ alert("grt!"); }) });
Simple tab, why is this not working??
Can someone please help me out. Please look at the line under $(.tabs).click it does not work like that, but it does work fine if I replace $("#pane .tabpane .selected") with just $(".selected"). Any help would be appreciated. Thanks! <html> <script src="../js/jquery-1.4.2.min.js"></script> <style> .selected{ //display:block; } </style> <script> $(document).ready(function(){ $('.tabs').click(function(){ $("#pane .tabpane .selected").hide(); $("#pane .tabpane .selected").removeClass('selected');
autocomplete with a textfield and its id
Hello guys! Actually I have this html interface; <input type="text" size="20" name="brandname" /> <input type="hidden" name="brandid" value="" /> And this is my jquery; $('#brandname').autocomplete("searchbrandnames.jsp", { minChars: 3 }); OK... the ideas here is that; Once the user type something into that textfield, the jquery will work to have a somekind of autocomplete... like what google does for example. But here, if we notice from the interface above, There is
.animate({}) doesnt work with zIndex?
Animate doesnt seem to work with zindex. I dont see anywhere this is mentioned on the animate() page. $("#myelement").animate({zIndex: 10}) .animate({opacity: 1), 1000); Opacity is affected but not zIndex. I can change zIndex the normal way though: $("#myelement").css('zIndex', '10');
jQuery ajax xml help
Hi, I need a way that a xml file needs to retrived from the server in synchronous way $(document).ready(function(){ var x=$.ajax({ type: "GET", url: "status.xml", cache: false, async: false, dataType: "xml", complete: function() { $(this).addClass("done"); } }); if(x.done) { // process the xml } }); I´ve set it to async: false so why it does not
How to add slide effect when switching images with external trigger?
Hi, I'm really new at jquery and am trying to achieve a relatively simple effect but having a hard time. I have the code to swap the images displayed in a particular div with an external trigger but want to add a slide effect to the new images that loads upon activating the trigger. The code I have so far is: <script type="text/javascript"> function changeBelt(beltName,BeltHolder) { var obj = document.getElementById(BeltHolder); var imgBelt = "<img class='belt' src='"+beltName+"' border='0' />";
Insert iframe using jquery? (newbie question)
I currently have a website with a number of menu items, many of which result in the main site being redisplayed but with an iframe being inserted somewhere within the middle of the page. The iframe is initially loaded as hidden but there is a JavaScript 'onload' routine which calculates the height of the iframe and then makes it visible in order to avoid the iframe showing scrollbars since the content of the iframe is variable. Roughly, things look like this: Menu button: reloads main page and passes
how to convert standard HTML node to JQuery?
Inside a function: mygrid._in_header_multiselect_filter=function(t,i,d){ The first parameter is a HTML node (http://docs.dhtmlx.com/doku.php?id=dhtmlxgrid:header_extra#custom_shortcuts_creation). I want to turn it into a JQuery version of the same so I can deal with it using JQuery, i.e. accessing it's children, setting up it's onclick event, etc. How to convert it to JQuery?
Unified way to change elements values
Hi guys, My problem here is quite simple: I have a wrapped set of elements, and I would like to change the value of each one of them. Take a look here: init : function() { $('[data-role="page"]').live('pagebeforecreate', function(e) { var page = $(e.target); Localization.localize(page.find('[i18n]')); }); }, localize : function (page) { page.each(function(){ elem = $(this); elem.val("My Test"); }); Is there a unified way to change the value of an element without considering
Simple problem with onBlur and focus()
Hello everyone, I'm having a simple/stupid problem with a check-in system I wrote. The computer has a barcode scanner hooked up to it that generates the code and a tab character. When the page on this computer loads, I do a focus() on our input box (only one on the page) and it's ready to scan. When a student scans in their ID, the barcode gets entered into the box and then the box gets tabbed out. The input box has onBlur that fires my jQuery function register_number. This function launches some
Accessing a list after AJAX call
I have a page that creates one unordered list from the contents of another list. The second list is created from a database query and is hidden on the page. I have written a JQuery function shown below that does an AJAX call which causes the hidden list to be created and that is working perfectly. The problem is that when the code following the AJAX call is executed it doesn't see the hidden list. The alert message displays 0 the first time. clicking on the Load button a second time results in the
Hide all but one div
Hi there, this problem has been bothering me throughout the day and I can't fix it. It seems rather simple, though. I have some divs laid on top of each other. By clicking somewehre specific I want to hide all the divs but except for one - which is related to the point i clicked - to show up. Here is my code so far: The function will be called by something like this: <a href="javascript:void(0)"><img src="album_emilia.jpg" width="90px" height="125px" onclick="setAlbum('emilia')"/><p>Emilia</p></a>
Adding element after others
I have a page with several uls which are enclosed within a div like so: <div id="post_holder"> <ul> <li></li> </ul> <ul> <li></li> </ul> </div>i am trying to insert another ul underneath the others within the div. however it inserts the new ul underneath the first ul in the list rather than at the bottom. can anyone see where i am going wrong? var ni = document.getElementById('post_holder'); var new_post = document.createElement('ul'); ni.parentNode.insertBefore(new_post,
loaded html and its delegation
Hello everyone...!! I have this html interface; ( a link, and a div ) Well, yes... once the Link from the UL LIST is clicked then it will load up the HTML file into the Middle DIV <div id="middle"> </div> <!-- div middle ended --> <div id="kiri" > <ul id="menu" class="treeview-red"> <li><span>Management Setup</span> <ul> <li id="supplier"><span>Supplier</span></li>
loading large data
hi everyone, using jquery autocomplete combobox i load more than 25000 data's i set minLength:3, delay: 700, when i start typing three characters, in the third character ie8 shows the "Stop running this script" how to handle this huge amount of data
Can't detect click on ul li element
$("ul#menu li").click(function() { alert('Handler for menu click() called.'); }); The above is a function I made to detect when a menu item is clicked on. The menu is made by using CSS on a ul tag's li children. Each li is a different menu item. It doesn't work. Any help is appreciated. -- Gid
How to read [object Object] returned by Ajax
I have var list = [someID, name, email, "0"]; dataToSend = JSON.stringify({ list: list }); $.ajax({ type: "POST", url: "metodos.aspx/sendEmailYCrear", contentType: "application/json; charset=utf-8", data: dataToSend, dataType: "json", success: AjaxOkAndAdd, error: AjaxFailedEmail });Which sends the data to the URL ok. I process everything on the C# code behind with no problem. But the returned value (I create a string to return some values) is recognized as an [object
load() function 's problem - Cross sites issue?
in my html page, i have a .load function to load a page from a public page on the Internet. it works when i preview it in my computer. it does not work when i put it on the server.. How can i solve? is that something like the server is blocking the cross site request? i don't know if this issue would happen to .load() function
Execute function and subscribe at the same time?
Hello, we're trying to enhance and optimize the forms in our projects with jQuery, but i don't know if something we want is posible... nowadays we are using simple javascript to enable and disable elements in our forms, we have a part to execute when the document is loaded and another that is executed with the interaction of the user. For example, we have a simple select with "Race" : "Caucassian", "African" and "Other", when the user selects something we enable or disable a textfield (where the
Trying to get the id from a checkbox that has been clicked
Hi, i can successfully bind click events to dynamically added checkboxes, but stuck on how to actually get the checkbox's id attribute out. thanks in advance... (using mvc 3 with razor) <script language="javascript" type="text/javascript"> $(document).ready(function () { $('.clickers').bind('click', function (item) { alert($(item).attr('id')); }); }); </script> @using (Html.BeginForm()) { <div data-role="fieldcontain"> <fieldset data-role="controlgroup" class="clickers">
reading xml-file and processing with jquery
Hello, I'm still kinda new with jquery, but here's my problem. I got this xml-file named --> slider-content.php In this xml-file, I get for projects with there data out of a database and is put into the xml-file. What I now want, is that every project is placed within another array variable. I got this far: function processXML(xml) { $(xml).find('project').each(function() { arrayVariable = [$(this).find('id').text(), $(this).find('titel').text(),
Jquery .post with json problem
Hi, I am having a strange problem with my jquery code. I am making an ajax call to a php page and everything seems to work fine except the resulting JSON is coming as [Object][Object], [Object][Object] and so on. Here is my jquery code $.post('user/getPreviousInsertedTSData',{month:month},function(response){ alert(response); },"json");And here is my php code: $this->load->model('timesheets'); $resSet['result'] = $this->timesheets->getUserReport($month,$user); $resStr = json_encode($resSet['result']);
jquery.js HELP ?
Firstly i dont have much idea about jquery.js or coding but i am trying to learn as i go along Anyway i have vbulletin forums and i am trying to install a modification that uses jquery.js and bar.js The coder who made the mod has tried to help but can only get it to work using his host for the jquery.js and bar.js I have the code in my "Header" template The following code should be used : <!--- rocketDock Menu developed and Translated to Arabic By Twi[L]ighT Dz , www.shba7.cc/vb --> <!DOCTYPE html
live() instead in jquery 1.26?
[CODE] $('#content').find('p:eq(0)').append('<span class="more"> | more</span><span class="less"> | less</span>') $('p:gt(0)').hide(); $('.more, .less').live('click', function() { $('#content').find('p:gt(0)').slideToggle(); $('.more, .less').toggle(); }) [/CODE] i using drupal-6,the jquery is 1.26. if i don't want to upgrade the jquery. is there a way to get the effect? jquery is 1.26 haven't have a suppport to the live() function. is there another function can instead of it. or alter the
JQuery Drag and Drop functionality not working
I am attempting to build a page, however using some sample code the page have drag and drop functionality. After using a simple jqeury statement to add to this form, every thing working (drag and drop)properly. Now my actual requirement is I need to generate the controls dynamically. Whne I generated all controls from server side and put all the generated controls HTML snipet in <div id="sort1" class="groupWrapper"> its working fine but when I try to put same HTML snippet in the same DIV using JavaScript
How should I document function return type from deferred function?
Let's say, I have a function: /** * My deferred foo * @returns {???} */ function foo() { var dfd = new $.Deferred(); good_old_assync(function(result) { dfd.resolve(result); }); return dfd.promise(); } What should I put for "???"? What is the correct data type?
long poll via .getJSON wierdness on IE7
I'm using long polling for a simple chat. On IE7, however, something bizarre happens: function longPoll () { var data = new Object(); data['room'] = document.getElementById('room').innerHTML; data['user'] = document.getElementById('username').value; alert("poll!") // debug $.getJSON('/chat', escape(JSON.stringify(data)), function (resp, status) { if (!resp) { setTimeout('longPoll()', 250); /* Chrome needs delay */ return; } for (var
Append inside append
I've got a div (mainDiv) that gets appended with a click of button. This 'mainDiv' consists of another div (insideDiv) that needs to be appended inside the 'mainDiv'. In other words, I am trying to append a div which is inside already appended div. Hope I am clear. Definitely I am doing something wrong that it's not working. Will much appreciate to know what am I doing wrong here. HTML form: <div class="mainDiv"> <div class="insideDiv"> Inspected Level <select name="locationId[]">
Lambda functions in jQuery
Hi ! I'm new in jQuery, and seeing the examples I have noted that you always use lambda functions. Is there any reason for that? why you don't make something like this: $('something').click(on_click); ... function on_click(event) { ... } I think is more clear than: $('something').click( function(event) { ... }); And we can edit and reuse the function easily, also if you are using an editor like Netbeans you can see all your functions in a list. Even more, I think in some situations is
Check if form has elements or is empty?
Hi, I was wondering if I can get some help. I have a form that is a regular form but in some cases it might be empty. <form id="myform"></form> or it might have some elements <form id="myform"><input name="X" value="X" /><input name="Y" value="Y" /></form> What is the proper way to count or check if the form has say inputs, select, textarea, etc..., or check if it's empty?
How does the jquery ui framework icons work?
Hi, everyone, since I'm try to understand the tools I'm working with (and to satisfy my curosity): how does the framework icons work? I understand the concept with the background and the negative offsets to adress one small piece of the background. So I expected to find the icons as a grid in the according iu-icons_... png's - but they all seem to be empty respectively contains only one color. So where are the icons? Thx in advance for your support!
Active staying button
Hey guys im stuck atm. I cant figure out how to fix this problem. I want my button to stay active when I click on it and turn into the normal one until I click on the other button and so on. Css doesnt help me out in this case. jquery is needed :p someone knows how to fix that ?
Set attr error in IE 8
Hello guys, I'm tried to set attribute for <a> element by code: $('#aID').attr('href', url); It's work good in Firefox. But, in IE8 occur a bug: href attribute have no change instead, an attribute added in <a>: jQuery15038535942919934396="354" Sometime, href attribute have change (view in Developer Tool), but click on <a> , it not is new value, it's old value. This bug also happen with TR tag when i try to set bgcolor attribute. Why? Please help me about this case. Thanks.
Google's new image search results page
I am intrigued by the way it shows rows of images which are neatly justified, left AND right sides. I was trying to figure out how they manage to do that so I could incorporate it into an image scroll of my own. Do you suppose they are cleverly pre-selecting images for each row so they fit nicely or is there some sleight of hand going on with how they size them? Every so often I DO see thumbs that have a few pixels cropped off the sides. What I DON'T see are images where they've been cropped
Use jQuery to echo value from SQL database
I'm looking to fill out an input box, and onBlur get info from the database and echo it. Very similar to how you register on this site, when you fill out a username, onBlur it checks to see if the username is available and echos yes or no. I want to fill out a username, and when you click out of the textbox, echo the First and Last name if it exists. any help on how to do this at all if very appreciated! :)
Mixing 'this' with selector (syntax problem)
Hi :) Does someone know how to mix 'this' with a selector? Tried this but it doesn't work : $(this + '" > img").attr("src") Thanks a lot for the help :)
Cross domain AJAX (YQL) - Navigate between consequent data pages of the variable query changed by click
I have some divs: <div id="id1"><h3>A</h3><h4>X</h4></div> <div id="id2"><h3>B</h3><h4>Y</h4></div> <div id="id3"><h3>C</h3><h4>Z</h4></div> And use xdomainajax plugin ( YQL powered) - to load external pages. I added the following function : When i click on div it search for <h3> contents in the external dictionary and loads it to the "#cont" $("div") .click(function(){ var filter = $('h3',this).text(); $('#cont') .load ('http://jisho.org/words?jap=*'+filter+'*'); }); In current form
How do I force a div to scroll?
I have a div with a scroll bar. It contains various child divs, and when the user sees them, they are in vertical order. So he can scroll to whatever child div he wants to. Then he can click on an arrow, and the entire child div expands to reveal a lot of text. This all works. But I'd also like to make the child div scroll up to the top of the parent div. Otherwise, it could happen that the user clicks on a child div that is near the bottom of the screen, and it expands, but most of the content
replaceWith method for
Hi Guys I have this form: <form name="summary" method="post" action="https://edgeoftheworld.securetill.com/index.html?v3rYm4dVaR5=c57d1fafd44a333bf1e9de02eb123052&url=www.edgeoftheworld.co.uk" onsubmit="submitGift(); disableSubmitSmry();"> <input type="hidden" name="action" value="payment"> <td align="center" class="column_main"> <br><!----></td> </tr> <tr> <td align="center" class="column_main"> <input type="submit" name="submit" value="Submit" class="buttonstyle" onmouseover="this.className='buttonstyle
Assigning elements to classes to control events
I'm trying to use a javascript class to assign specific event handlers to different elements. I create an object and pass it a reference to the element, and some properties for the event handler to use. When the event fires, I want the handler to reference the properties of the object. But I'm clearly doing something wrong as multiple instances all refer to the most recent object only. Any pointers? <script> function constrainTextarea(ele,maxlength) { this.ele = $("#"+ele); this.maxlength=maxlength;
Next Page