Is is better to set up data before click or onclick?
Bit of a jquery noob. I have a simple function that replaces the href content on a link with that of a data attribute. The function looks for the class click-reveal and performs the action. I'm unsure of which is the best route, 1) call a function that replaces all in my page load function, or 2) do it onclick with a redirect. A code sample for the second variation is shown below. var gotoOutPage = function (e) { pd(e); var url = $(this).data('url'); $(this).attr("href", url) window.location
onclick in span
hi guys my code working in ahref now i wanna apply in another div with span, some tips? code bellow. <script type"text/javascript"> //<![CDATA[ function change(type){ $('.teste a').removeClass( 'arial' ); $('.teste a.q'+type).addClass( 'verdana' ); if(type=='page1'){ citem(iten1); }else{ citem(iten2); } } var iten1 = "<? echo $['page1']; ?>"; var iten2 = "<? echo $['page2']; ?>"; //]]> </script> <!-- now this div working.... --> <div class="teste"> <a href="#" onclick="change('page1')" class="arial">on</a>
How can I attributes exist?
I'm a bit of a noob at jquery, so would appreciate some help if possible. I am making some changed to a link, by taking the content of a data tag and inserting it into the href tag. This seems to work ok at the moment but I'd like to ensure that both exist before carrying out the function. Can anyone advise? var gotoOutPage = function (e) { pd(e); var url = $(this).data('url'); $(this).attr("href", url) window.location = $(this).attr('href'); } Thanks in advance.
Upgraded to JQM 1.1.1 and header jump returns - only on dynamic pages
I am using the Sea of Clouds twitter script and it was working fine in 1.0.1. I've upgraded to PhoneGap 2.1.0 and have everything up to par except for this page issue. If I load in 10 or 15 tweets, so that the page has to scroll, on the initial page load, the header drops about 1/4 of the page. Once swiped, the header jumps back and seats correctly at the top of the screen without further issue. Seems like it is only happening on the initial page load. Can't seem to figure this one out. Using
How to make JQM to an downloadable app
Hi, I am sure this must be one of those baby footstep questions. Say I have am having an jQM + php + Db(JPD) built application fully functional. As of now, there is no device specific features that this application is depending upon. If I type web URL it works in the smart phones. Now if I have to provide this as downloadable app is it possible and where should be the cut-off, I mean all processing are done at the server side. (basically nevertheless to say php generates the rendering JQM scripts).
How do I send delete an item using PHP,AJAX,jQuery?
Hello I need to know how to delete an item using ajax and jquery and PHP? Normaly here is how i do it using PHP only <a href="removeItem.php?id=10">Remove Me</a> in the removeItem.php file i do something like this $id=$_GET['id']; mysql_query("DELETE ***********");so I want to do the same thing using jQuery and ajax so the page will not refresh! so when a user click "Remove Me" link it will instantly remove that item without refreshing the page. Thanks for your help
Validate plugin with contenteditable divs
Hi - Is there any way to use the jQuery validate plugin with contenteditable divs? i.e. <div id="editme" contenteditable="">Editable Text</div>What I want to do is something like this: $("#editme"[contenteditable]).validate();I can attach events to the field using syntax like the above. But, since contenteditable doesn't actually create or use a form, I can't figure out what to attach the validate() to. Is there a way to attach a validate() to just a single element without a form? Thanks! -steve
How to pass parameters to jquery functions kept in external file?
Hi, I want to pass some values to jquery function, which kept in external file. Can we pass values to such external functions? and how? Thank you.
Ajax call doesn't hit ASPX Page Method
Trying to call a WebMethod on an ASPX page from jQuery.Ajax call on client. Have seen this done on several web pages and instructionals. Problem seems to be that the actual web method is never 'hit' although the ajax call returns success, all that is in the data returned is the html of the page that made the call. Using VS2010, jQuery 1.8.1 PAGE CODE: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebMethodReturnsDataTableJSON.WebForm1" %> <!DOCTYPE html PUBLIC
Problem with jQuery.ajax ()
Good afternoon, I'm having a problem with the method jQuery.ajax () and ja walked laps here and did not find solution anywhere. What happens is this, you have this code in functions.js: function login() { var user = jQuery("#user_login").val(); var pass = jQuery("#pass_login").val(); jQuery("section #login").effect("fade", 500); jQuery.ajax({ type: "POST", url: "ws/login.php", dataType: "json", data: { user: user, pass: pass
re enable cycle script after partial update
Hi Im using the cycle plugin and I really like this plugin, thanks! But i have a problem. I am doing some partial update of my site and i need to re enable my cycle scripts after new divs has been added to the container. I cant figure out how to this know how I can do this.
ajax loader gif garbled
help: my ajax loader gif is messed. I copied a replacement to the 'css/images' folder but still looks garbled.
custom scrollbar not working when loaded via ajax
Hello, Can someone help me please?Actually im using a custom scrollbar which on load is applied to a div tag,which works fine,but after the content of the div is replaced with new content via ajax,the custom scroll stops working. Can anyone help me about it? Thanks
popup jquery
i am looking for popup jquery plz suggest i added some but its not working for me plz help
style active link
I created a demo. http://imunderdevelopment.com/john/demo/link.html I want the active link to NOT be hidden but the other menus to be hidden. I'm not sure how to have my jquery know/select the active link. var DDSPEED = 10; var DDTIMER = 15; var OFFSET = -2; var ZINT = 100; function ddMenu(id,d){ var h = document.getElementById(id + '-ddheader'); var c = document.getElementById(id + '-ddcontent'); clearInterval(c.timer); if(d == 1){ clearTimeout(h.timer); c.style.display = 'inline';
Countdown timer with milliseconds
Hi All, I am trying to create a countdown timer, that will down from 10 minutes. I can show the minutes and seconds but the problem is how can I show up the milliseconds for example my timer running like 09:26 for minutes and seconds I need to show 09:26:50 with milliseconds also in two digits. Please help me. Thanks in advance..
Issue with movable widget using jquery
Hi, I am using movable widgets in my application. I am using .aspx page and in that aspx page I am loading user controls (.ascx) file dynamically using LoadControl. Structure of widget (user control) is as follows <%@ Control Language="C#" AutoEventWireup="true" CodeFile="TestUserControl.ascx.cs" Inherits="widget_TestUserControl %> <li class="Testmod1 NotMovable" id="mod1"> <div class="Testmod1-head"> <div class="Testmod1-head-cont"> <div class="sIcon"></div> <span class="Testmod1Title"> <a
Hiding Fields - NewForm.Aspx
Can anyone help me please. I created a sharepoint list, and so on the NewForm.apsx have received the standard template fields.. like attachments. I need to hide all of those fiekds as I have buttons above now added via infopath to create the selection into the standard fields so they do not need to be seen. Can you hide elements using the "Table Class" id because that would take care of the whole section at once. Many thanks for reading this. Craig
Issue with jquery validation plugin on IE9
Hello all. This is my first post on the board and comes from an afternoon of exasperation. I have a form that needs to send data, I installed the plugin jquery validation, which works perfectly on chrome, on firefox and IE8 ... but does not work on IE9. The code is as follows: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script src="js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="http://jzaefferer.github.com/jquery-validation/jquery.validate.js"></script>
Click event gets fired multiple times
Hi, I have following htnl code <div id="divTag1"> <div class="singletagblock" > <a href="/Tagging/BrowseTag" id="tagname">tag for details page</a> <a href="" class="removetag" id="removeTag1"></a> </div> <div id="addtag1" style="display:inline-block"> <a href="#" >+Add tag</a></div> <div id="divAddTagBox1"> <input id="txtTag1" name="tags" type="text" value="" /> <input type="button" value="Add" id="btnAddTag1"/> <input type="button"
jQuery Mobile modal dialog window doesn't submit correct with Begin.Ajax
i have some problems with a modal dialog in my jQuery mobile / mvc 2 application. when submitting the modal dialog the returned view opens in main window and not as expected in modal popup. my modal dialog is implemented as an aspx page that looks like this: <%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage<Models.ContactData>" %> <div data-role="page" id="Contact"> <div data-role="header" data-theme="a"> <h1>Contact</h1> </div> <div data-role="content" data-theme="a"> <% Html.EnableClientValidation();
JqGrid-Json-WebService
Hi all! Help me with my problem,please. <script type="text/javascript"> $(document).ready(function () { $.ajax({ type: "POST", url: "WebServiceMonitoringLog.asmx/Stations", data: "{}", contentType: 'text/json;charset=UTF-8', dataType: "json", success: succ, error: err }); function err(data, request, status) { alert('------\n' + data.responseText + '\n------'+'\n'+request+'\n'+status);} function succ(data, status) { jQuery("#addtree").jqGrid({ url: 'WebServiceMonitoringLog.asmx/Stations', datatype:
Getting animate and fadeIn events to work
Hi Guys, l just started using jQuery a few days ago and l ran into a couple of issues l'm trying to solve. Here is what l need to do: 1) A user clicks on a link a - A heading fades in Then b) a paragraph/details animate up, to just below the heading 2) The user clicks another link and the same thing as above happens but for a different heading and details. a - The previous heading and details disappear. I have this partly working, 1) works but 2) fails and l want to make sure l
Selecting the country drop down changes the state drop down
Hello I have a form with the country drop down list which has all the countries..if I select one country I need to populate the respective states of the country...can any one help me how to do it using jquery html php?? Thanks
Linking to jquery-1.7.1.js
Hello Everyone: I've been using jQuery for about 3-4 months now and like it a lot. This past week I registered a second domain on my hosting account. My hosting provider allows me to develop the new domain within my current hosting structure. So now my file structure looks like the following: /public_html as root for main domain name /public_html/jquery as folder for all my jquery files, including jquery-1.7.1.js /public_html/mynewdomain as the ROOT folder for mynewdomain.com Obviously I've no desire
how to make a request when i leave a especific page
hi all, i need to do a request when i leave a especific page in jQueryMobile, can i bind a event of jQueryMobile to do that? or have another way to do it? thanks!
Glow via dropshadow with Jquery
Hello. I am just wanting to add a simple dropshadow to some text. I've looked for solutions online but most of the ones I am seeing are not quite right. The text is as follows (this text is not defined in the CSS, it is actually a list of names pulled from a database): I want the effect to make the text look like: Any help is appreciated. Thank you!
site with jquery vertical accordion, can it be converted to responsive behavior?
Intro: Hello, I'm trying to build a site that contains this accordion here. http://tympanus.net/codrops/2011/07/22/vertical-sliding-accordion/ I noticed that it has fixed values in the javascript settings for height and width. Now I want to make the site responsive, to adjust to different screens up to mobile's. Question: Is it possible to use a plugin to dynamically resize an accordion like this or just I use a different plugin? Thanks
clone() not copying the css in my anchors
Why does .clone() copy the css styles for some elements and not my anchors I am doing something like this $('a.button').clone().prependTo('#container'); I am only getting the value of the anchor, not the styling. Any help would be greatly appreciated
Is there a max length on data-url parameter?
Just launched update to our mobile site with JQM ver 1.1.0 and jQuery ver 1.7.2! Is there a limit to length of data-url? Here is our value and it is throwing Javascript error: Error: Syntax error, unrecognized expression: data-url='/FlightStatus/ShareDetails?CarrierCode=UA&FlightNumber=1&Origin=IAH&Destination=HNL&DepartureCity=Houston%2C%20TX%20(IAH]&ArrivalCity=Honolulu%2C%20HI%20(HNL)&DepartureTime=9%3A41%20AM&ArrivalTime=1%3A01%20PM&DepartureDate=Mon.%2C%20Oct.%201%2C%202012&ArrivalDate=Mon.%2C%20Oct.%201%2C%202012&MarketingCarrierCode=UA&OperatingCarrierCode=UA&MarketingFlightNumber=1&OperatingFlightNumber=1')
.is() combined with get(i) issues
Hello guys, first things first excuse me for my bad english. So here's my story: I want to get through 8 Checkboxes, to proof if they are checked or not. In case one of them is checked, i get the name, or better the ID of it, to activate the <div> it belongs to. So here are the Checkboxes: <input type="checkbox" class="checkbox" name="1" onclick="$('#' + $(this).attr('name')).toggle()"/> Thema 1 <input type="checkbox" class="checkbox" name="5" onclick="$('#' + $(this).attr('name')).toggle()"/> Thema
Need help with jquery for blogger
Hello, I'm feeling rather frazzled and frustrated. I have been searching for days, trying to find a simple explanation of how to make an image appear when someone mouses over a word, exactly like a tooltip but with no text. I'm blogging about magic decks, and I currently have the cards linked back to another site. But what I really want is them to have an image appear of the card itself when someone mouses over them, preferably in a static spot on the blog. The address to it is cheapmana.blogspot.com
jQuery HTTP post request
Hi! As I am new to jQuery i have to ask for the .post function! I was using before the XMLHttpRequest object. But with this I got problems with special characters in the received XML. Changeing the encoding didn't help so far... This I want to do: Post an http request with an XML document and receive an XML response. // Send the xHTTPRequest to the server in the browser adress function httprequest(xmlReqList) { // Überprüfen ob XMLHttpRequest-Klasse vorhanden und erzeugen von Objekte für IE7,
JQuery Form Plugin: Can not select form in the future
So I have the following: var content = '<td><form id="EmailForm" method="post" action="' + path + '">' + '<input type="text" class="eList" name="emailList" title="Email(s)..."/>' + </form>'</td>'; $(this).parent().after(content); $('#EmailForm').ajaxForm({ success: function(d) { } }); This form is not being selected after it is dynamically inserted. What can I do to select it in the future ?
Rebind a unbind click
Hey all, I am using this library that allows you to create a more elegant alert box (you can even use images!); I used it with a click function and it works! A nice container opens with a close button, GREAT! I noticed if you happen to click more than once on the link you assigned, it keeps firing. So multiple images begin to propagate. I used the unbind method, but it cancels the link permanently (until refresh etc.). I was surprised to see the library doesn't compensate for this little problem,
Download builder, swipe events and mobileinit
Hi all, At this stage in my project I only want to use the swipe events of jQuery Mobile. I've used the download builder with just the default options ticked, and that gives me the events required. However I am trying to modify the value of $.event.special.swipe.horizontalDistanceThreshold as I find the default value doesn't suit my needs. But it appears that this property needs to be changes within the mobileinit event which doesn't get fired at all. I have my scripts included in the correct order
making whole divs fade in from black and white on mouseover?
hello everyone, i need some help please. please see http://i-n-t-e-l-l-i-g-e-n-t-s-i-a.com/entry.html On this page there are four columns of images. There is some jquery (which is commented out at the bottom of the html, see script below also) that coverts all images to black and white and when you hover they fade to colour, which is what i am trying to apply to these images. however when i do apply it it totally changed my css. how can I get this to work on this page? $(window).load(function(){
Jquery Basic Slider / Jcarousel combined
Hi all I will try to keep this brief. I am using Jcarousel to display a small panel of image thumbnails. Here is the HTML for them: <ul id="mycarousel" class="jcarousel jcarousel-skin-tango"> <li id="showimage-scroll_257.jpg"><img src="/products/scroll_257.jpg" /></li> <li id="showimage-scroll_259.jpg"><img src="/products/scroll_259.jpg" /></li> <li id="showimage-scroll_258.jpg"><img src="/products/scroll_258.jpg" /></li> <li id="showimage-scroll_260.jpg"><img src="/products/scroll_260.jpg"
memory leaks with IE9 - with nothing
Hello together, I try it again. I have a problem with jQuery and IE9, if I load a simple side (see below) on every load the memory increase about 4-5 MB. I try it with different versions of jQuery 1.7.1 / 1.7.2 / 1.8.1 / 1.8.2 -> on all there is the same effect. if I load the side with other browsers I had no problems. if I load the side in IE9 with compatibility mode, there is no problem. if I load the side with meta http-equiv="X-UA-Compatible" content="IE=8", there ist also no problem. I that
How to iterate a Map in jquery?
Hai, I am using Jquery Mobile, Spring3 mvc. I have the problem with iterating the loop.....the following is my code in Controller class : Map<String,List<String>> test=new HashMap<String, List<String>>(); List<String> temp1=new ArrayList<String>(); int i=1; for(DoMenu l:menuList){ List<String> temp=new ArrayList<String>(); temp.add("submenu "+(i++)); temp.add("submenu "+(i++)); temp.add("submenu "+(i++)); test.put(l.getMenuId().toString(), temp); } model.addAttribute("test1",
Next Page