Need help getting html page contents
For some time now I'm struggling to get some div content from this page http://dbpedia.org/page/Milan All I need is this part: Milan is a city in Italy and the capital of the region of Lombardy and of the province of Milan. The city proper has a population of about 1,300,000, while the urban area is the fifth largest in the European Union with an estimated population of 4,300,000. The Milan metropolitan area, by far the largest in Italy, is estimated by the OECD to have a population of 7,400,000.
Superfish - Open drop downs to left instead of right
On my website the navigation is at the top and right aligned. When you hover over the items on the right and the drop downs begin to appear they drop down and fold out to the right and consequently off the page and not very visible. Is there a way to tell the drop downs to roll out to the left instead of right?
.width returning zero on occasion??
I have a weird bug that's occuring in pretty much all the browsers. If I close the tab, and then hit Ctrl -> Shift -> T to bring it back the width() method returns 0 on an appended image instead of what the image actually is. Hitting refresh on the tab removes this bug and everything works fine. I will also say that trying .css('width') and document.getElementById('divShadowLeft'); both also return 0 for this bug. I can't show all the code for security reasons, but I'll just outright ask.. what
Can anyone help me with this problem?
Please what am i doing wrong? i write this code using CI in my controller and i have a view file am loading as well but is only the data that am able to get in not inserting it into the jqgrid table can anyone help?? class ML2 extends Controller{ var $gsm; var $keyword = 'ml'; var $email_add; var $firstname; var $body; var $per_page = 50; function Ml2() { parent::Controller(); $this->load->model('Ml_model'); $this->load->model('sms_model_reseller'); //$this
Dynamically-generated form with file input doesn't work in IE
Hi all, I'm trying to create a form dynamically using JQuery that includes a "file" input. I'm not having any luck. My server never gets the file. Both work fine when I submit from Firefox. I created a static HTML version that works just fine, and I think the form I created using JQuery is identical. Any ideas? Thanks, Don <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" >
Background Change with fadeIn. How?
Total noob here about jquery. /* Javascript */ $(document).ready(function(){ $("a.one").click( function(){ $ ("body").removeClass('bg2 , bg3 , bg4').addClass("bg1"); }); /* CSS */ .bg1{ background: url(../images/1.jpg); background-repeat: no-repeat;} /* HTML */ <a class="one" href="#"><img class="bkgbtn" src="1.png"></a> As you can see, I have it set to where when you click on the button, "a class=one" is talking to the js and the js is talking to the css to get the background
How to use variable in selector field?
I am new to Jquery. Is it possible to use variables instead of selectors? If yes can anyone help me please? For example, instead of #list2, #list3 at the code below is it possible? $(function(){ $("select").change(function() { var selectedAttr = this.getAttribute("id") var convid = $(this).val(); if (selectedAttr=="list1"){ $('#list3').empty(); } $.ajax({ type: "POST", url: "handTodb1.asp", data: "convid=" + convid, success: function(ajaxResponse) { var temp =
Simulating click doesn't work
I'm trying to simulate a click, but nothing happens. Here is my code: $(document).ready(function() { $(".linkall") .click(function() { $(this).find("a:last").click(); }) .find("a").click(function(event) { event.stopPropagation(); // needed to prevent an endless loop. Also, because this click has presedence over the other click, this prevents all links from resulting in the same page }); });Here is my HTML: <div class="category linkall block"> <img src="products/drill-pipes.png"
Jquery - selector not selecting multiple checkboxes IE
In IE, The selector for multiple inputs is not working whereas in firefox it is. Below is the html. <td><input id="contactInfo.shippingAddress.city" name="contactInfo.shippingAddress.city" onchange="needToConfirm = true;" type="text" value="city" maxlength="100"/></td> <td ><input id="contactInfo.shippingAddress.state" name="contactInfo.shippingAddress.state" onchange="needToConfirm = true;" type="text" value="state" maxlength="100"/></td> <td><input id="contactInfo.shippingAddress.addressZipCode"
simple question on submit
Hi, I have an input text out of any form (it's a search entry). <a href="/users/user/list/" id="cuser">Cerca</a> l'utente <input id="search_user" type="text" name="user" /> I'd like to trigger some action when the user activates the input text and I thought the code would do: $('#search_user').submit(function() { var href = $('#cuser').attr('href'); var value = $('#search_user').attr('value'); $('#list_users').load(href + value + '/' + '?nt=1&mode=regexp'); return false;
binding shortcuts after an ajax call
I'm using jquery 1.4.2 with jquery.hotkeys-0.8 (from github repository) and I'm having trouble with binding shortcuts to links after I load a new page into my div called content. Here is my jQuery: function bind_shortcuts(target){ // Step through every ajax link and bind the keys in accesskey to that link $('a.ajax[accesskey]').each(function(e){ key = $(this).attr('accesskey'); link = $(this); target.unbind('keydown', key, function(e){ }); // doesn't unbind???
jquery ajax calls & microsoft internet explorer issues
can anyone summarize the issues with jquery ajax calls with IE and what the workarounds are? I'm having users complain about issues of an ajax call not working, however, I've been unable to reproduce this or see the error myself. Works fine in firefox/safari/chrome. I have windows7 + IE8/IE7 to test and that works. My call looks like this... var data = {trainer_class:trainer_class,monster_type:monster_type}; var d = new Date(); var args = { type:"POST",url:"/bamo/api/init_trainer/?_requestno="+d.getTime(),data:data,dataType:
[jQuery] Match a named dropdown
Dear, I'm looking for a way to match a dropdown with a specific name. Unfortunately, I cannot add a id to this field. Here is the html code of my dropdown: <select name="opportunity_type"> <option value="" selected="">--None--</option> <option value="controle">Controle</option> <option value="security">Security/option> </select> And I'm trying to access it in this code: $("select").change(function () { $("select option:selected").each(function () { if ($(this).val() == "controle" ) { ... } }); })
Need help with cross domain POST using .ajax or json(p) grabbing and formatting returned data
Im trying to validate a form (easy) and POST it to a third party WCF service. I am able to validate and POST data to the service, but its returned data (in table format) keeps opening in a blank page with their url in the browser address bar. Can't have that, I need to grab the returned data and .append it to a div on my page. Here is what I have that FAILS <script type="text/javascript"> $(document).click(function() { //cancel form $.validator.methods.equal = function(value, element,
Need sample code for creating a popup window after login without address bar & status bar in firefox and IE
i need window popup ! not div up i tried http://swip.codylindley.com/popupWindowDemo.html this link sample ! it is not at all working Please help me
IE 8 problems; loading jquery causes a blank page
I'm currently using JQuery to generate a Datepicker for a web app I'm working on, and I've encountered a strange problem that occurs when I link to the jquery-1.4.2 core in IE 8. When I open one of the pages that uses the datepicker, it visibly renders most of the document and then, when loading is complete, the entire page is replaced with a blank. Refreshing causes the page to appear as normal, and the underlying html is visible in the debugger. To give further background, the page is built in
Cannot insert table rows in IE8, why?
Hello all, This is my first question here, I would like to know what is wrong here that table rows/cols are not being inserted when using IE8, in FF and Chrome it works fine: What am I doing wrong? var listFriends = eval(data.list); var col = 0; var ie8 = browser.isIE8; var tr = $('<tr>'); tableFriends.find('tbody').remove(); // clear table rows $.each(listFriends, function(index){ var contr = col % 6; if (contr== 0){ // new table row tableFriends.append(tr); tr = $('<tr>');
Getting an elements coordinates (offset() issues)
What is the best way to get the position of an element relative to the document (accounting for margins as well)? I would like to position another element over it. I'm using the offset() function but i am running into issues 1. The values for top & left returned in IE 8 (perhaps other versions) are incorrect. 2. Offset() doesn't take into account margins of the element. And when margins are set to auto i cannot seem to get the correct margin values to use Thanks for the help.
role of event parameter in function(event)
$(".delete").live('click', function(event) { $(this).parent().parent().remove(); }); wat is the role of the event argument passed here. also wat does 'live()' do?
function arguments
hey guys im trying to make a select all checkbox script but i'm having problems with getting the argument and putting it into a variable all the code is below...but it is this code which seems to be the problem i believe... function toggleCheckboxes(group, element) { group = $('input[@name='+ group +']'); var group_checkbox_count = $(group).length; var group_checked_count = $(group:checked).length; ..... if anyone could tell me where i'm going wrong please...thank you <!DOCTYPE html>
remove a table row and also pass a parameter to the function removing tr
i wish to remove a table row on click i do know that it can be done using the following code $('#myTable tr').click({ $(this).remove(); return false; }; what if i also wanted to pass a certain value as a parameter to this function. basically what i wanna do is, i have a 'x' on each row so when a user clicks it i want the row to delete and at the same time wish to use ajax and delete that row from the database as well.
jQuery IE 7 Problem - Not animating
Hi, I am currently working on this page: Click Me (sorry for mega loading times) and there seems to be an issue with it in IE7. FF3.6.4, IE8 and Chrome handle it fine but IE7 doesn't want to animate my banner. What should happen is when the main image is rolled over, the red box with the arrow should animate out and show information and using jQuery Cycle plug-in, it should scroll through the images (3 in total). In IE7 however, it simply does not and I'm trying to figure out why, is the way I set
Trying to create dropdown menu - need it to stay open while hovered
I know this is simple and has been done before. I'm trying to create a dropdown menu for secondary links. I want it to appear when you hover over a primary link. I can't do a simple .hover function with two handlers because once the user moves the mouse to go into the secondary menu, it will slide back away. The easy solution is to put that secondary menu within the selector of the primary menu - but it's not possible with my setup. Any ideas for this? Thanks
IE: jQuery and Prototype conflict
Hi, For some reason, my page has to use both prototype and jquery. However, there is a weird problem about getting width and height of an element using jQuery. Here is my test page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Test Conflict</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <script>var $j
invalid JSON
I have a page with <select> items. I'm getting their values from a AJAX request, as a JSON string : [{"product_option_1":[{optionValue:1, optionDisplay:S}]},{"product_option_2":[{optionValue:3, optionDisplay:Rouge}]}] product_option_1 and product_option_2 are the name of my <select> items. and into the brackets, their values. But Firebug tells me that JSON is not valid. Where is the mistake ?
syncronous ajax request and variables outside of the request
I've built a function that handles my ajax calls. I know it doesn't make much sense in this small test script i built, but i would really like to have this work in this way. I'll explain the script then post it below. First, i have a function that creates a dialog based on the parameters passed in. I simplified the function for this test to only accept one parameter; an ajax options object. Inside of this function, i am creating a default ajax options object, extending it with the ajax options object
Opening pages with Ajax
Hello, Please, can you help me? I'm in a hurry... I have a main page (gallery.asp, Ex.1) that loads, via jQuery ajax, another page (picture.asp, Ex.2) It's all fine when I first open the "gallery.asp" page: the "picture.asp" page loads into the "test" div with the first record I want ('cause of the snippet marked as "// load first picture onLoad") In my idea, clicking on the "#next" and "#prev" link (that, please notice, are in the "picture.asp" page - so they are ajax-loaded) should load "/picture.asp?iData=<%=
Assigning variable to object at children.eq(0)
Hello all I am trying to assign a variable to a jquery object that is found using the children() and eq() methods. This is a simplified version of the html structure. <div> <a href = '#' class = 'link'>Link </a> <input type = 'button' id = 'button' / > </div>Here is the jquery code. All I want to do is assign an object to the variable and be able to manipulate the object through the variable. $("#button").click(function(){ var link = $(this).parent().children(".link").eq(0); //Do things with the
jQuery .ajax submit, PHP Proxy and Cross Domain Ajax
Is it possible? having trouble getting it to work, has anyone accomplished the following before? From form on your site, HTTP Post to another domain and format the response as data on your page asynchronously? Im guessing you use the Proxy to make your page think its getting the return data from its server? Any advice appreciated.
Why disabling cache doesn't work?
Here is my script <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script> <script type="text/javascript"> jQuery.ajaxSetup({ // Disable caching of AJAX responses cache: false }); jQuery("#button1").click(function (e) { window.setInterval(refreshResult, 3000); }); function refreshResult() { //alert("In refreshResult"); jQuery("#divResult").load("/Home/Refresh");
Problem with ajax timeouts and IE7
I'm using $.ajax and I'm having jQuery throw an error inside its code. From 5229 of the uncompressed jQuery.. try { var oldAbort = xhr.abort; xhr.abort = function() { if (xhr) { oldAbort.call(xhr); } onreadystatechange("abort"); }; } catch (e) { Line # 6 above is what is throwing an error in IE's debugger. Yes, its in a try/catch, but that isn't stopping IE from throwing an error and preventing my $.ajax error function from
unbind a plugin (or something)
Hi. I'm using this plugin: http://remiya.com/cms/projects/jquery-plugins/htmlbox/ It's a wysiwyg text editor plugin. I load it onto a jquery ui dialog form after opening the form because that was the only way I could get it to work when the dialog opened. The problem I have is that it get's duplicated each time the dialog form opens, so I think I need to unbind it or something... The plugin comes with a function to 'remove' it but I haven't figured out how to call it. This is the code for loading
Load an IFRAME with asynchronous?
Hi, I'm in the process of trying to shave off as much load time from my site as possible :) I notice that this takes a heck of a long time to load: <iframe src="http://www.cancunandrivieramaya.com/cgi-bin/gallery/ad_frame.cgi?area=Top;do=" style="width: 468px; height: 60px;" scrolling="no" frameborder="0">Sorry, you don't seem to have IFRAMES enabled</iframe> Is there a better way I can do this? Maybe using AJAX with ASynchronous? (like we're doing with GAnalytics on the site) TIA for any suggestions.
$(document).keydown event handler not getting triggered the first time
So I have an event handler for the KeyDown event in a Javascript file but for some reason it does not get called the first time a key is pressed. However, if a key is pressed or a mouse button clicked then the next time I press a key it does get called. Here is the relevant code: ........................... // Other stuff $(function() { //Other stuff ............................. $(document).keydown(function(e) { alert('keydown event'); .................................
append table row after x number of columns.
Hello everybody, I'm trying to append <tr> after every x number of <td>'s. I'm not sure how to do it. Here the code which I'm trying to do. End result: should be 10rows and 10 columns. <script language="javascript" type="text/javascript"> $(document).ready(function(){ var i = 0; for(i=1; i<=100; i++) { $(".Numbers tr").append("<td>"+ i +"</td>"); if(i == 10) { $(".Numbers").append("</tr><tr>");
How to process posted data using ajax inside a tab?
hi, iam a new jquery user. I loaded a php file inside a tab using an example given in jquery website, say example.html. I did not alter the javscript part. The classes.php loads and it is actually a form and its action is now set to itself. So when this form is posted, it loads classes.php instead of example.html. Please say how to correct it? <script type="text/javascript"> $(function() { $("#tabs").tabs({ ajaxOptions: { error: function(xhr, status, index, anchor) { $(anchor.hash).html("Couldn't
Toggling div z-index using jQuery?
Hi guys! Im totally new to jQuery - so take it easy on me :) Im developing a new DotNetNuke site for a friend, and Ive developed a fancy Flash navigation header for the site sitting in a div tag at the top of the site. It has some dropdowns, so the flash move takes up the top 300px of the page. I have the "content" div sitting halfway down through this flash movie under the flash div, so the transparent flash movie's submenus float over the content. However, Im finding that Im unable to select/click
usage of a variable doesnt work in IE
Hello I have a problem with the usage of variables. In Firefox and Chrome it works well, but IE doesnt accept my coding like this: $(".myelement").click(function () { var hashelement = $(this).attr("id"); $("table#"+hashelement).show(); }); The alert of the variable "hashelement" represents the right ID of the element, but IE doesnt show the table with the ID. What am I doing wrong? Thanks domi
How can I know the size of an image in a div (image bigger than the div) ?
Hi everyone, I'm having a little trouble with something a bit ridiculous. I have an image in a div, let says that the image's width is 100px (but in fact 300px, resize with em) and the div's width is 75px (it's an absolute div created by a plugin). I tried to do $('img').width() naturally, but it gave me the div's width. I tried some natives javascript methods (clientWidth, offsetWidth and scrollWidth), same things (but Firebug is saying that clientWidth is 100px, not 75px :'( ). I'm lost :( Any
Front End Developer needed - Expert Javascript / jQuery / CSS / HTML5 / AJAX - c£60k Contract or Perm
Hi I am recruiting a role on behalf of a key client who has won a large contract with an international beverage company. I have pasted the spec below. Please email me at sanjay.aggarwal@opilio.co.uk if you are interested and would like further information. London based tech startup in entertainment sector looking for a JavaScript / HTML5 application developer in an effort to create the next generation of entertainment formats. This is a very cool shop and really innovative product! Responsibilities:
Next Page