Re: [jQuery] Re: img src replacement
Hi Glen. I'm late to the thread (and this is probably a bit off-topic for this list) but up until the point where you asked for the cross-fade, everything you need can be done with vanilla CSS, no need to involve jquery at all. In the page: Currently accepting new jobs In the CSS: div#availibilty a.available-button { display: block; float: right; width: 169px; height: 222px; border: none; background: url('images/avail.png) top left no-repeat; text-indent: -3000px; } div#availibilty a.available-button:hover { background: url('images/availhover.png) top left no-repeat; } I put up the example above using your images: http://b.ite.me.uk/css_demo.html One advantage to this is that it works in browsers that have javascript turned off, and also that screen readers etc. will still see the link as text (try looking at it in Firefox with styles turned off to get an idea what a screen reader sees). Improved accessibility is always a good thing. Hope this helps, if not for this (CSS can't do you a cross-fade) then maybe other projects, Mark
Re: [jQuery] Re: Need help learning
Thank you, you have help out so much On Jan 6, 2010, at 6:14 PM, Šime Vidas wrote: > If you want to manipulate with the DIV inside the $.get function, you > can declare a local variable and put the reference to DIV in it... > > (function($) { >$.fn.myPlugin = function() { > >this.each(function() { >alert(this.id); > >var that = this; > >$.get("return.php",function(data) { >// now "this" is "that" >alert(that.id); >//do something with "this" & the > "data" >}); >}); >return this; >}; > > })(jQuery); > > > You don't have to call the variable "that", but it's a nice name, > isn't it? :)
[jQuery] jQuery Cycle Plugin width problems
The Goal I want to cycle through list items in an unordered list. I want the list items to take up the full width of the browser, even when the browser is resized. The Problem Once the first slide transition takes place and the browser is resized smaller horizontal scroll bars are introduced. Then when the browser is resized larger than the original size, the list item width is only as wide as it was when the page was first loaded. The Assumption The cycle plugin needs to calculate the width of the item it is transitioning and then sets it to that width. The Question Is it possible to keep all widths as percentages maintaining the fluid width of the list item? The HTML Label Applicators Print and Apply Table-Top Printers High Speed Custom Systems LA PA TT HS CS The CSS .slideshow { margin: 43px 0 0; height: 340px; } .slideshow li { height: 340px; width: 100%; overflow: hidden; } The Javascript $(document).ready(function() { $('.slideshow').cycle({ fx: 'fade', height: 'auto', width: 'auto', fit: 0, containerResize: 0, speed: 1400, timeout: 6000, pager: '#ssnav', manualTrump: false, pagerAnchorBuilder: function(idx, slide) { return '#ssnav li:eq(' + idx + ') a'; } }); $('#ssnav li a').click(function() { $('.slideshow').cycle('pause'); }); }); The Attempts I've tried things like overflow: hidden in the CSS. I've tried options in Cycle like width, fit, contatinerResize. Thanks for any help on this.
Re: [jQuery] Re: sorting columns using jquery. noob with html and java. built custom php using snmp
Thanks for that awesome explanation. I just asked because the data isn't sortable. But it's very nice looking... When I click Host Name or Device Type, it just highlights it. I guess I was just hoping jquery would figure it out, and make those columns sortable. I assume I need to some how tell it to. Host Name Device Type Firmware Version Software Version edge-109c-gs.gov.ntwk470-24T3.6.0.7v3.7.3.13edge-241c-gs.anx.ntwk470-24T 3.6.0.7v3.7.3.13edge-399c-gs.anx.ntwk470-24T3.6.0.7v3.7.3.13 edge-1c-cr.ngc.ntwk5510-48T5.0.0.4v5.1.0.015 On Tue, Dec 29, 2009 at 8:54 AM, brian wrote: > Leave it in the PHP file. The tablesorter file should be left clean. > Think of it as a library that you include. The snippet of code you > referred to is something that makes use of that library. Don't be > fooled by the script tags. While the file is a PHP script, any PHP > code is parsed on the server. The script tags, however, are parsed by > the browser's JS engine, and are unrelated to PHP. > > On Tue, Dec 29, 2009 at 11:25 AM, Mark K. Ayler Jr. > wrote: > > Alex, > > Thanks so much. It does look a lot better...and looking through your > > changes, it makes perfect sense. Thanks for doing that. > > > > > > Are you sure this code belongs in my .php file or should it be in the > > jquery.tablesorter.min.js file? > > > > $(document).ready(function() { > > // call the tablesorter plugin > > $("#results_table").tablesorter({ > >// enable debug mode > >debug: true > > }); > > > > }); > > > > > > On Tue, Dec 29, 2009 at 5:08 AM, Alex Mcauley > > wrote: > >> > >> You have alot of unclosed tags in there ... > >> > >> Let me help you out a bit and pastebin how it should look!... > >> > >> > >> This should help > >> > >> http://pastie.org/759936 > >> > >> > >> On Dec 28, 6:44 pm, ace123 wrote: > >> > I'm not sure if this is possible...but I love the jquery tablesorter- > >> > but I can't figure out how to get it working. My page displays as if > >> > it's not even there. I used php to snmpget some data from my network > >> > switches and routers. It saves it to my DB...then I have this page to > >> > display the information from the database. This is where I want to be > >> > able to sort, by switch type, software version, etc. I'm not a code > >> > guy, just a network engineer trying to make my job easier. Your help > >> > please is MUCH appreciated. I've been trying to get this to > >> > work off and on for 6 months. > >> > > >> > This is what I've got so far > >> > > >> > The page looks something like this when I load it. > >> > > >> > Host Name Device Type Firmware VersionSoftware > Version > >> > > >> > edge-109c-gs.gov.ntwk 470-24T "3.6.0.7" "v3.7.3.13" > >> > edge-241c-gs.anx.ntwk 470-24T "3.6.0.7" "v3.7.3.13" > >> > edge-399c-gs.anx.ntwk 470-24T "3.6.0.7" "v3.7.3.13" > >> > > >> > > >> > > >> > > >> > >> > $username="root"; > >> > $password=""; > >> > $database="switchesdb"; > >> > mysql_connect(localhost,$username,$password); > >> > mysql_select_db($database) or die( "Unable to select database"); > >> > $query="SELECT * FROM switchcode"; > >> > $result=mysql_query($query); > >> > $num=mysql_numrows($result); > >> > ?> > >> > > >> > > >> > </ > >> > script> > >> > <script type="text/javascript" src="/var/www/html/ > >> > jquery.tablesorter.min.js"> > >> > >> > $(document).ready(function() { > >> > // call the tablesorter plugin > >> > $("table").tablesorter({ > >> > // enable debug mode > >> > debug: true > >> > }); > >> > > >> > }); > >> > > >> > > >> > > >> > > >> > > >> > > >> > Host Name > >> > Device Type > >> > Firmware > Version >> > th> > >> > Software > Version >> > th> > >> > > >> > > >> > > >> > >> > $i=0; > >> > while ($i < $num) { > >> > $host_name=mysql_result($result,$i,"host_name"); > >> > $device_type=mysql_result($result,$i,"device_type"); > >> > $firmware_version=mysql_result($result,$i,"firmware_version"); > >> > $software_version=mysql_result($result,$i,"software_version"); > >> > ?> > >> > > >> > > >> > > >> > >> > ?> > >> > > >> > >> > $device_type; ?> > >> > >> > =strstr($firmware_version, "\""); echo ($cleanstring); ?> > >> > >> > =strstr($software_version, "\""); echo ($cleanstring1); ?> > >> > > >> > > >> > > >> > > >> > > >> > >> > $i++;} > >> > > >> > ?> > > > > > > > > -- > > Mark K Ayler Jr. > > CCNA, MCSE, NNCSS, OASIS. > > > > > -- Mark K Ayler Jr. CCNA, MCSE, NNCSS, OASIS.
Re: [jQuery] Re: sorting columns using jquery. noob with html and java. built custom php using snmp
Alex, Thanks so much. It does look a lot better...and looking through your changes, it makes perfect sense. Thanks for doing that. Are you sure this code belongs in my .php file or should it be in the jquery.tablesorter.min.js file? $(document).ready(function() { // call the tablesorter plugin $("#results_table").tablesorter({ // enable debug mode debug: true }); }); On Tue, Dec 29, 2009 at 5:08 AM, Alex Mcauley < webmas...@thecarmarketplace.com> wrote: > You have alot of unclosed tags in there ... > > Let me help you out a bit and pastebin how it should look!... > > > This should help > > http://pastie.org/759936 > > > On Dec 28, 6:44 pm, ace123 wrote: > > I'm not sure if this is possible...but I love the jquery tablesorter- > > but I can't figure out how to get it working. My page displays as if > > it's not even there. I used php to snmpget some data from my network > > switches and routers. It saves it to my DB...then I have this page to > > display the information from the database. This is where I want to be > > able to sort, by switch type, software version, etc. I'm not a code > > guy, just a network engineer trying to make my job easier. Your help > > please is MUCH appreciated. I've been trying to get this to > > work off and on for 6 months. > > > > This is what I've got so far > > > > The page looks something like this when I load it. > > > > Host Name Device Type Firmware VersionSoftware Version > > > > edge-109c-gs.gov.ntwk 470-24T "3.6.0.7" "v3.7.3.13" > > edge-241c-gs.anx.ntwk 470-24T "3.6.0.7" "v3.7.3.13" > > edge-399c-gs.anx.ntwk 470-24T "3.6.0.7" "v3.7.3.13" > > > > > > > > > > > $username="root"; > > $password=""; > > $database="switchesdb"; > > mysql_connect(localhost,$username,$password); > > mysql_select_db($database) or die( "Unable to select database"); > > $query="SELECT * FROM switchcode"; > > $result=mysql_query($query); > > $num=mysql_numrows($result); > > ?> > > > > > > </ > > script> > > <script type="text/javascript" src="/var/www/html/ > > jquery.tablesorter.min.js"> > > > $(document).ready(function() { > > // call the tablesorter plugin > > $("table").tablesorter({ > > // enable debug mode > > debug: true > > }); > > > > }); > > > > > > > > > > > > > > Host Name > > Device Type > > Firmware Version > th> > > Software Version > th> > > > > > > > > > $i=0; > > while ($i < $num) { > > $host_name=mysql_result($result,$i,"host_name"); > > $device_type=mysql_result($result,$i,"device_type"); > > $firmware_version=mysql_result($result,$i,"firmware_version"); > > $software_version=mysql_result($result,$i,"software_version"); > > ?> > > > > > > > > ?> > > > > > $device_type; ?> > > > =strstr($firmware_version, "\""); echo ($cleanstring); ?> > > > =strstr($software_version, "\""); echo ($cleanstring1); ?> > > > > > > > > > > > > > $i++;} > > > > ?> > -- Mark K Ayler Jr. CCNA, MCSE, NNCSS, OASIS.
[jQuery] Re: validate - error messages keep piling up
Works now :) Had to create a special class that combined all three classes. On Dec 17, 5:36 pm, Mark Livingstone wrote: > OK, thanks. I will try and report back. > > On Dec 16, 12:22 pm, Jörn Zaefferer > wrote: > > > You have three classes specified for the errorClass. The plugin can't handle > > that. If you actually need more then one class, use the highlight and > > unhighlight options to add and remove those. > > > Jörn > > > On Wed, Dec 16, 2009 at 4:43 PM, Mark Livingstone > > wrote: > > > > On Dec 16, 9:59 am, Jörn Zaefferer > > > wrote: > > > > > At least post your full JS codes instead of just excerpts. > > > > > Jörn > > > >http://jsbin.com/isuco/edit > > > > I can e-mail you the link to my working page if that will help. > > > Unfortunately I cannot share it here.
[jQuery] Re: validate - error messages keep piling up
OK, thanks. I will try and report back. On Dec 16, 12:22 pm, Jörn Zaefferer wrote: > You have three classes specified for the errorClass. The plugin can't handle > that. If you actually need more then one class, use the highlight and > unhighlight options to add and remove those. > > Jörn > > On Wed, Dec 16, 2009 at 4:43 PM, Mark Livingstone > wrote: > > > On Dec 16, 9:59 am, Jörn Zaefferer > > wrote: > > > > At least post your full JS codes instead of just excerpts. > > > > Jörn > > >http://jsbin.com/isuco/edit > > > I can e-mail you the link to my working page if that will help. > > Unfortunately I cannot share it here.
[jQuery] Re: jQuery ajaxStart() Event Handler
Actually scratch that - it was staring me right in the face... For anyone else who is interested, use: $.ajax({ type: 'POST', url: , beforeSend: function () { // show load message }, success: function (msg) { // message to display on success }, error: function (msg) { // message to display on error }, complete: function () { // hide load message } }); Sometimes I just get in my own way! On Dec 17, 5:23 am, Mark wrote: > I have two Ajax methods in a page. The first handles the loading of > html content in response to a user 'click' event, the second in > response to a form submission. I want to have a 'loading...' message > appear for the form submission but not the html load. But when I fire > the html load event, the 'loading...' message appears above the form. > > How can I separate the ajaxStart() event for two different Ajax > methods on the same page? > > Cheers, > Mark
[jQuery] jQuery ajaxStart() Event Handler
I have two Ajax methods in a page. The first handles the loading of html content in response to a user 'click' event, the second in response to a form submission. I want to have a 'loading...' message appear for the form submission but not the html load. But when I fire the html load event, the 'loading...' message appears above the form. How can I separate the ajaxStart() event for two different Ajax methods on the same page? Cheers, Mark
[jQuery] MultiFile Emulation
I'm trying to emulate the multifile plug-in (http://www.fyneworks.com/ jquery/multiple-file-upload/) with files stored on a server. This worked with the 1.24 version of the plug-in. I've upgraded to the 1.46 version and now it isn't working fully correctly. This is my relevant HTML: This is what I have for JavaScript code: $(document).ready(function(){ $('#tufilelist').MultiFile(); }); function fileAppend(fileId, fileName){ appendDbFile('tu-' + fileId + '-' + fileName); } function appendDbFile(fileinfo){ $('#tufilelist').val(fileinfo).change(); } Notice the type is text instead of file and the field is hidden from the user. So, all I'm looking for is the adding and removing items from a list of values. The PHP code on the back-end parses the stings to actually attach the files to the item we're working on. With 1.24, I'd get HTML like this: [remove] db-32715-pic1.JPG [remove] db-32777-doc1.pdf [remove] db-32716-pic2.JPG With 1.46, I get HTML like this: x db-32715-pic1.JPG x db-32777-doc1.pdf x db-32716-pic2.JPG
[jQuery] Re: validate - error messages keep piling up
On Dec 16, 9:59 am, Jörn Zaefferer wrote: > At least post your full JS codes instead of just excerpts. > Jörn http://jsbin.com/isuco/edit I can e-mail you the link to my working page if that will help. Unfortunately I cannot share it here.
[jQuery] Re: validate - error messages keep piling up
On Dec 16, 9:59 am, Jörn Zaefferer wrote: > At least post your full JS codes instead of just excerpts. > > Jörn http://jsbin.com/isuco/edit I can e-mail you the link to my working page if that will help. Unfortunately I cannot change it here.
[jQuery] Re: validate - error messages keep piling up
Jörn , it's hard to extract the code and make it functional just for jsbin.com Basically, the validation plug-in APPENDS element that contains the error message right after the input field. When another message appears, it appends it again instead of first removing the initial message. My workaround is ugly but does the job: onkeyup: function(element) { $(element).next().remove(); }, focusInvalid: false, invalidHandler: function() { $("span").each(function(){ if($(this).attr("class") == "input- notification error png_bg") { $(this).remove(); } }); }, onfocusout: function(element) { $(element).next().remove(); $("span").each(function(){ if($(this).next().attr("class") == "input- notification error png_bg") { $(this).next().remove(); } }); }, This basically shows error messages only when the form is submitted. When the input field is in focus, it removes the error message. The onfocusout option removes repeated messages. I just can't figure out why it would behave this way. On Dec 16, 8:58 am, Jörn Zaefferer wrote: > Could you provide a full example, eg. via jsbin.com? > > Jörn > > On Wed, Dec 16, 2009 at 2:53 PM, Mark Livingstone > wrote: > > > anyone? :) > > > On Dec 15, 12:37 pm, Mark Livingstone wrote: > > > Hi, > > > > Since I moved to a new design I cannot figure out how to stop the > > > validate plug-in to append error messages and instead have it remove > > > the previous error message before creating another one. > > > > here is what my HTML code looks like with multiple error messages: > > > > > > > > > > E-mail > > > > > > > > > > > > This field is mandatory > > > > > > > > > This field is mandatory > > > > > > > > > This field is mandatory > > > > > > > > > This field is mandatory > > > > > > > > > Please enter a valid e-mail address > > > > > > > > > > CSS: > > > > .errorValidate { > > > padding: 2px 0 2px 22px; > > > margin: 0 0 0 5px; > > > } > > > > JS: > > > > var validateForm = $("#clientUpdateForm").validate( > > > { > > > errorClass: "errorValidate", > > > /etc/... > > > > } > > > > Any ideas why it would do that? > > > > Thanks in advance!
[jQuery] Re: validate - error messages keep piling up
anyone? :) On Dec 15, 12:37 pm, Mark Livingstone wrote: > Hi, > > Since I moved to a new design I cannot figure out how to stop the > validate plug-in to append error messages and instead have it remove > the previous error message before creating another one. > > here is what my HTML code looks like with multiple error messages: > > > > E-mail > > > > This field is mandatory > > > This field is mandatory > > > This field is mandatory > > > This field is mandatory > > > Please enter a valid e-mail address > > > > CSS: > > .errorValidate { > padding: 2px 0 2px 22px; > margin: 0 0 0 5px; > } > > JS: > > var validateForm = $("#clientUpdateForm").validate( > { > errorClass: "errorValidate", > /etc/... > > } > > Any ideas why it would do that? > > Thanks in advance!
[jQuery] validate - error messages keep piling up
Hi, Since I moved to a new design I cannot figure out how to stop the validate plug-in to append error messages and instead have it remove the previous error message before creating another one. here is what my HTML code looks like with multiple error messages: E-mail This field is mandatory This field is mandatory This field is mandatory This field is mandatory Please enter a valid e-mail address CSS: .errorValidate { padding: 2px 0 2px 22px; margin: 0 0 0 5px; } JS: var validateForm = $("#clientUpdateForm").validate( { errorClass: "errorValidate", /etc/... } Any ideas why it would do that? Thanks in advance!
[jQuery] How To Upload Video File Using JQuery
Hi, I am looking for a way to use JQuery to upload video files. Since these files are so large it is important to provide a cue to the user when the download is in progress and when it ends. Thanks, Mark
[jQuery] Jquery form plugin and accessing formData
I am using the excellent jquery form plugin to obtain form data, do some pre-submission processing, and pass the altered form on to a django view via ajax for some additional processing. I have a jQuery form plugin "beforeSubmit" function to basically divide a form field by 12 if another "monthly/yearly" checkbox is checked, and pass the altered value on to django. I have a html form called "myForm" with a bunch of text inputs "amount1", "amount2", "amount3", etc. and two checkboxes for each text input "amount1my", "amount2my", "amount3my" etc. for the user to select whether "amount" fields are monthly or annual amounts (the checkbox values are "m" and "y") I bind the form in $(document).ready(function() : var options = { ... beforeSubmit: myBeforeSubmit, ... } $('#myForm').ajaxForm(options); } What I want to do is search the form data for a "y" value in any of the checkboxes, and if present, get the related amount field and divide by 12. the beforeSubmit function is basically this: function myBeforeSubmit(formData, jqForm, options) { //for loop to get the name of each formData name field containing "y" - I get this using match(/y/) - so far, so good ///strip the field name of the "my" to get the underlying "amount" field name and create new variable "theFieldName" for the resulting stripped string - so far, so good. //This all works to this point, but when I try to do the math on the field: formData.theFieldName.value = formData.theFieldName.value/12; // the jQuery Form plugin sees "theFieldName" as a form field name which of course does not exist } Question: it is possible to insert a variable in the formData.[field name].value statement? Mark
[jQuery] Jquery post for google intensity map - tabs don't work?
I've been struggling with an issue for while now: trying to do a partial page update to a google intensity map visualization using jquery. Recently tried setting up a JSON builder and using the jquery.post method to get the data from the server. Eureka! Or so I thought. The intensity map I draw has three tabs and while the data does return fine via the JSON and the map draws fine, the tabs don't work at all. When I select them, the map stays on the first data series. I tried setting up a "select" event handler and using getSelection()/ setSelection() to force an update to the chart, but no go. Any help would be greatly appreciated. I have posted in the code below. Thanks. Mark. - http://www.w3.org/1999/xhtml"; > Usage Statistics JSON Map $.chart = null; $.chartdata = null; google.load('visualization', '1', {packages:['intensitymap']}); google.setOnLoadCallback(drawMapChart); function LoadMapData(){ $.chartdata = new google.visualization.DataTable(); $.chartdata.addColumn('string', '', 'Country'); $.chartdata.addColumn('number', 'Hits', 'a'); $.chartdata.addColumn('number', 'Users', 'b'); $.chartdata.addColumn('number', 'Orgs', 'c'); var StartDate = "1/1/2009"; var EndDate = "11/1/2009"; var OrgType = "1"; var OrgID = "*"; $.post("/getJSONData.aspx?builder=GetMapData", {StartDate:StartDate, EndDate:EndDate, OrgType:OrgType, OrgID:OrgID}, function(data){ $.chartdata.addRows(data.length); for(i=0;i<data.length;i++){ $.chartdata.setValue(i, 0, data[i].StateCode); $.chartdata.setValue(i, 1, data[i].TotalEvents); $.chartdata.setValue(i, 2, data[i].UserIDs); $.chartdata.setValue(i, 3, data[i].OrgIDs); } google.visualization.events.addListener($.chart, 'ready', readyHandler); $.chart.draw($.chartdata, {region: 'usa', width: 440, colors: ['dodgerblue', 'firebrick', 'orange']}); google.visualization.events.addListener($.chart, 'select', selectHandler);; } ,"json"); } function drawMapChart() { $.chart = new google.visualization.IntensityMap (document.getElementById('chart_div')); LoadMapData(); } function selectHandler(e) { alert('select event'); }
Re: [jQuery] Re: How can i make a timer that i can stop with jquery?
Hey, Thanx for that code but i see one problem. It's not gonna work with multiple countdowns (which i have). Perhaps i need to send the animate object between the start and stop actions to be able to stop a certain "animation" (countdown)?? @Michael Geary i actually have that option working but without displaying the countdown: var countdown = setTimeout(function(){ form.submit(); }, 5000); $("body").append("cancel"); like that.. but how do i display the number after the "cancel" text? Thanx to all so far, Mark On Fri, Nov 13, 2009 at 1:50 AM, Phish wrote: > Hey Mark, > > The plugin uses a recursive function to achieve the countdown. You > can cancel the countdown by checking a global variable with each > decrement in the number. > > Line 19: > $(this).animate({ > 'fontSize': settings.endFontSize > },settings.duration,'',function() { > if (cancel_countdown == 1) return; // this cancels the > countdown > if(to > settings.endNumber + 1) { > $(this).css('fontSize',settings.startFontSize).text(to > - 1).countDown(settings,to - 1); > } > else > { > settings.callBack(this); > } > }); > > > You'll need to set the global variable 'cancel_countdown' when > starting, and canceling the countdown. > > HTML: > > > > > More jQuery: > > $("input#start_countdown").click(function(){ > // start countdown code > cancel_countdown = 0; > }); > $("input#stop_countdown").click(function(){ > cancel_countdown = 1; > }); > > > Hope this helps, > Renato. > > On Nov 12, 4:39 pm, Mark wrote: >> Hi, >> >> i tried this jquery countdown >> plugin:http://davidwalsh.name/jquery-countdown-pluginand it works neat.. but >> not for my interest. >> What i try to do is have this: >> >> Have a simple countdown that counts down from 5 to 0 then changes the >> text to "Uploading..." >> The plugin mentioned can do that but i also want to be able to >> "cancel" the countdown which it can't do. >> Can anyone point me to a plugin that does have that functionality? or >> how i make that in this plugin.. >> >> So what i want to be able to do: >> >> 5 >> 4 >> 3 >> 2 >> 1 >> 0 >> Uploading... >> >> Or when cancel is pressed >> >> 5 >> 4 >> 3 >> 2 >> CANCEL >> >> Just like that. >> >> I hope anyone can help me with this. >> >> Thanx, >> Mark. >
[jQuery] changing a select
I need to programmatically change the option that is selected within a select. I have code registered to run when this occurs, whether the selection is initiated by the user or programmatically. Why doesn't this approach work? $(document).ready(function () { $("select#foo").change(function () { alert("Now selected: " + $("select#foo > option:selected").text()); } } var select = $("select#foo"); select.find("option:first").select(); select.change(); The alert is only displayed when the user changes the selection, not when the code above changes it. -- R. Mark Volkmann Object Computing, Inc.
[jQuery] When to Use'.' When Referring To Css Classes In JQuery
Hi, Is there some general rule to determine when '.' should be added to JQuery method parameters when referring to CSS classes. Here's an example from the excellent book "Learning JQuery 1.3" if ($header.is('.sort-alpha')) { findSortKey = function($cell) { return $cell.find('sort-key') .text().toUpperCase() + ' ' + $cell.text ().toUpperCase(); }; } In this case both '.sort-alpha' and 'sort-key' are CSS classes. How does one know when to include the '.' Thanks, Mark PS. I accidentally placed this in the JQuery Plugin Discussions. Apologies for the duplication.
[jQuery] Re: Firefox problem on ajax loaded javascript
I have such similar case in my project, but it did work in FF and IE. but recent days, I found it does not work in Safari instead. On 11月2日, 下午6时29分, nomen wrote: > Hi all: > > I have a simple page. > Clicking in a button it loads a content by Ajax to the page, let's > call to it "subpage". > In "subpage" I have some HTML(some select lists) and a jquery code > in "$(document).ready(function(){...". The javascript code launches > another js (http://www.yxscripts.com/cs/chainedselects.html) and > this one affects to the loaded select list using the ID of the select > lists. > In IE8, IE7, Chrome and Opera 10 it works perfectly, but, in > Firefox, the ready function is fired but Firebug says that there is an > error because it can´t find the select lists ID. > What I´m doing bad? > > Thanks in advance.
[jQuery] Re: AJAX and JSON
On Mon, Oct 26, 2009 at 9:58 PM, MorningZ wrote: > > if this is your *exact* code > > $.getJSON(url + "?callback?", function (json) { > > then you're missing an equal sign > > $.getJSON(url + "?callback=?", function (json) { Good catch! Fortunately I had the = in my real code. I just forgot to type it in the email. > As for the rest of your issue of "what to do", this post should help: > > http://groups.google.com/group/jquery-en/browse_thread/thread/fd821bf488c9a9d3?hl=en# Okay, I think I understand about using jsonp now. I don't think I need it in my case though because my call isn't cross-site. So I still have these questions: 1) What should the response type be when using jsonp? 2) What should the response type be when not using jsonp? Is that just called plain json? 3) When not using jsonp, what should the server code return? Still JavaScript code that calls the callback function with the json content or just the json content? > On Oct 26, 8:14 pm, Mark Volkmann wrote: >> I have some code working that invokes an HTTP service that returns JSON. >> From my JavaScript I call the service with: >> >> $.getJSON(url + "?callback?", function (json) { >> // do something with json here >> >> }); >> >> My service is implemented as a Java servlet with a doGet method. >> In that method I: >> 1) set the content type of the response to "application/x-javascript". >> 2) get the value of the callback parameter >> 3) create a Java Map >> 4) use the org.json library to convert the map to JSON text >> 5) build a string of JavaScript code that calls the callback function, >> passing it the JSON >> 6) write the string of JavaScript to the response >> >> Is this the recommended approach? I was expected that >> I wouldn't need to pass the callback function name to the servlet and >> could just return the JSON from the servlet instead of a string of >> JavaScript code. -- R. Mark Volkmann Object Computing, Inc.
[jQuery] AJAX and JSON
I have some code working that invokes an HTTP service that returns JSON. >From my JavaScript I call the service with: $.getJSON(url + "?callback?", function (json) { // do something with json here }); My service is implemented as a Java servlet with a doGet method. In that method I: 1) set the content type of the response to "application/x-javascript". 2) get the value of the callback parameter 3) create a Java Map 4) use the org.json library to convert the map to JSON text 5) build a string of JavaScript code that calls the callback function, passing it the JSON 6) write the string of JavaScript to the response Is this the recommended approach? I was expected that I wouldn't need to pass the callback function name to the servlet and could just return the JSON from the servlet instead of a string of JavaScript code. -- R. Mark Volkmann Object Computing, Inc.
[jQuery] Preventing double submits
Hi, I am using jQuery and blockUI to prevent the user from submitting a form twice by double clicking on the interface: This is in my global js file and is called on every pages document.ready: $('form').submit(function(){$.blockUI({message:'', overlayCSS: {opacity:0.2}})}); This was working really well, but if I have validation on one of the form submits that returns false, I of course want to unblock the UI. Can you suggest a way of doing this? (without hard coding validation checks in the global js file?) Thanks for any suggestions
[jQuery] Re: AutoComplete Sends Null To Server Side Function
Thanks for the reply. I discovered the answer. A silly mistake actually. The AutoComplete parameter is "q". ASP.NET MVC Routes needs an exact parameter name match on the server side method. I was using the word "filter" instead of "q", so ASP.NET MVC passed in null to the server method. Mark On Oct 8, 10:45 am, MorningZ wrote: > Are you using firebug or another Developer Console like program to see > what request the AutoComplete is sending out? > > it should be something like > > http://yourwebsite/Serice/AutoComplete.ashx?q=foo&limit=10×tamp=... > > And all values can be accessed in ASP.NET via Request.QueryString, key > "q" has the value to search on > > On Oct 7, 10:50 pm, Mark Phillips wrote: > > > > > Hi, > > > I'm using the AutoComplete Plugin with ASP.NET MVC. For some reason > > the client side input value is NULL when it reaches the Server method. > > > Any suggestions would be appreciated. > > > Thanks, > > Mark- Hide quoted text - > > - Show quoted text -
[jQuery] AutoComplete Sends Null To Server Side Function
Hi, I'm using the AutoComplete Plugin with ASP.NET MVC. For some reason the client side input value is NULL when it reaches the Server method. Any suggestions would be appreciated. Thanks, Mark
[jQuery] Re: Simple Jquery AJAX post
in my example i would isted of alert($(data).find('result').text()); use $('.loading').text($(data).find('result').text()); if you had html then $('.loading').html($(data).html()) would work i think so long as you returned html you might have to tell it what the return type is just it normaly pics that up unless your html is malformed in yours i think you would just have to change your $ ("#response").html(html); to $("#response").html($(html).html()); maby $("#response").html($(html)); would work but it would depend on your input as somtimes that will brake and i never did work out why On Sep 30, 10:27 am, mattastic wrote: > Thanks very much for your reply, however, could you please tell me how > I can populate the loading div with the response text, rather than an > alert? > > Many thanks > > On Sep 29, 1:56 pm, Mark Gorman wrote: > > > yay for it not showing what you said before i posted, try on your > > start and stop doing $(document).ajaxStart(); for some reson is can be > > quite silly with that also use $(document).ready(); its nicer that way > > and avoids unexpected issues > > > On Sep 29, 1:52 pm, Mark Gorman wrote: > > > > this is how you do a post with loading at the top middle ish > > > > > > > > > > > > .loading { > > > display: none; > > > position: absolute; > > > top: 0px; > > > left: 50%;} > > > > > > > </ > > > script> > > > > </head> > > > <body> > > > <script language="Javascript" type="text/javascript"> > > > $(document).ready(function(){ > > > $(document).ajaxStart(function(){ > > > $('.loading').show(); > > > }); > > > > $(document).ajaxStop(function(){ > > > $('.loading').hide(); > > > }); > > > $('.clickme').click(function(){ > > > > //i have trouble with the post permiters so i always do > > > it the {} > > > way but you can just pass a array > > > $.post('example.cfm',{peram1 : 'hello',peram2 : 'world', > > > myval : $ > > > ('.myinput').val()},function(data){ > > > alert($(data).find('result').text()); > > > }); > > > return false; > > > }); > > > > }); > > > > > > > loading > > > Click me > > > > > > > > > > > > > On Sep 29, 11:15 am, mattastic wrote: > > > > > Thanks very much for your replies. > > > > > Could you please post the whole page code? > > > > > So I can see how the javascript, html and ajax works together > > > > > I'mn struggling to understand how the whole page is layed out. > > > > > Thanks in advance > > > > > On Sep 28, 2:18 pm, Mark Gorman wrote: > > > > > >http://docs.jquery.com/Ajaxhaseverythingyouneedbut a simple > > > > > example would be... > > > > > > $(document).ready(function(){ > > > > > $.ajaxStart(function(){ > > > > > $('.loading').show();}); > > > > > > $.ajaxStop(function(){ > > > > > $('.loading').hide();}); > > > > > > //i have trouble with the post permiters so i always do it the {} way > > > > > but you can just pass a array > > > > > $.post('example.php',{peram1 : 'hello',peram2 : 'world', myval : $ > > > > > ('.myinput').val()},function(data){ > > > > > alert($(data).find('result').text()); > > > > > > }); > > > > > }); > > > > > > if the return was xml ie it saved > > > > > then you would get it saved in a alert watch some of the functions > > > > > though if you tell it to expect something as it will just > > > > > brake. .loading i am useing as your loading graphic or a div > > > > > containing it etc using css to absolutely position it or putting it > > > > > wherever you want it. you can do better things if you want but if you > > > > > just trying things for the first time this will do :P > > > > > > On Sep 28, 10:58 am, mattastic wrote: > > > > > > > Could soneone please show me an example of a simple ajax post to a > > > > > > coldfusion page, with a loading graphic? > > > > > > > I cant find an appropriate example in the documentation. > > > > > > > Thankyou > >
[jQuery] Re: Simple Jquery AJAX post
yay for it not showing what you said before i posted, try on your start and stop doing $(document).ajaxStart(); for some reson is can be quite silly with that also use $(document).ready(); its nicer that way and avoids unexpected issues On Sep 29, 1:52 pm, Mark Gorman wrote: > this is how you do a post with loading at the top middle ish > > > > .loading { > display: none; > position: absolute; > top: 0px; > left: 50%;} > > > </ > script> > > </head> > <body> > <script language="Javascript" type="text/javascript"> > $(document).ready(function(){ > $(document).ajaxStart(function(){ > $('.loading').show(); > }); > > $(document).ajaxStop(function(){ > $('.loading').hide(); > }); > $('.clickme').click(function(){ > > //i have trouble with the post permiters so i always do it > the {} > way but you can just pass a array > $.post('example.cfm',{peram1 : 'hello',peram2 : 'world', > myval : $ > ('.myinput').val()},function(data){ > alert($(data).find('result').text()); > }); > return false; > }); > > }); > > > loading > Click me > > > > > On Sep 29, 11:15 am, mattastic wrote: > > > Thanks very much for your replies. > > > Could you please post the whole page code? > > > So I can see how the javascript, html and ajax works together > > > I'mn struggling to understand how the whole page is layed out. > > > Thanks in advance > > > On Sep 28, 2:18 pm, Mark Gorman wrote: > > > >http://docs.jquery.com/Ajaxhaseverythingyou need but a simple > > > example would be... > > > > $(document).ready(function(){ > > > $.ajaxStart(function(){ > > > $('.loading').show();}); > > > > $.ajaxStop(function(){ > > > $('.loading').hide();}); > > > > //i have trouble with the post permiters so i always do it the {} way > > > but you can just pass a array > > > $.post('example.php',{peram1 : 'hello',peram2 : 'world', myval : $ > > > ('.myinput').val()},function(data){ > > > alert($(data).find('result').text()); > > > > }); > > > }); > > > > if the return was xml ie it saved > > > then you would get it saved in a alert watch some of the functions > > > though if you tell it to expect something as it will just > > > brake. .loading i am useing as your loading graphic or a div > > > containing it etc using css to absolutely position it or putting it > > > wherever you want it. you can do better things if you want but if you > > > just trying things for the first time this will do :P > > > > On Sep 28, 10:58 am, mattastic wrote: > > > > > Could soneone please show me an example of a simple ajax post to a > > > > coldfusion page, with a loading graphic? > > > > > I cant find an appropriate example in the documentation. > > > > > Thankyou > >
[jQuery] Re: Simple Jquery AJAX post
this is how you do a post with loading at the top middle ish .loading { display: none; position: absolute; top: 0px; left: 50%; } $(document).ready(function(){ $(document).ajaxStart(function(){ $('.loading').show(); }); $(document).ajaxStop(function(){ $('.loading').hide(); }); $('.clickme').click(function(){ //i have trouble with the post permiters so i always do it the {} way but you can just pass a array $.post('example.cfm',{peram1 : 'hello',peram2 : 'world', myval : $ ('.myinput').val()},function(data){ alert($(data).find('result').text()); }); return false; }); }); loading Click me On Sep 29, 11:15 am, mattastic wrote: > Thanks very much for your replies. > > Could you please post the whole page code? > > So I can see how the javascript, html and ajax works together > > I'mn struggling to understand how the whole page is layed out. > > Thanks in advance > > On Sep 28, 2:18 pm, Mark Gorman wrote: > > >http://docs.jquery.com/Ajaxhaseverything you need but a simple > > example would be... > > > $(document).ready(function(){ > > $.ajaxStart(function(){ > > $('.loading').show();}); > > > $.ajaxStop(function(){ > > $('.loading').hide();}); > > > //i have trouble with the post permiters so i always do it the {} way > > but you can just pass a array > > $.post('example.php',{peram1 : 'hello',peram2 : 'world', myval : $ > > ('.myinput').val()},function(data){ > > alert($(data).find('result').text()); > > > }); > > }); > > > if the return was xml ie it saved > > then you would get it saved in a alert watch some of the functions > > though if you tell it to expect something as it will just > > brake. .loading i am useing as your loading graphic or a div > > containing it etc using css to absolutely position it or putting it > > wherever you want it. you can do better things if you want but if you > > just trying things for the first time this will do :P > > > On Sep 28, 10:58 am, mattastic wrote: > > > > Could soneone please show me an example of a simple ajax post to a > > > coldfusion page, with a loading graphic? > > > > I cant find an appropriate example in the documentation. > > > > Thankyou > >
[jQuery] Re: Simple Jquery AJAX post
http://docs.jquery.com/Ajax has everything you need but a simple example would be... $(document).ready(function(){ $.ajaxStart(function(){ $('.loading').show(); }); $.ajaxStop(function(){ $('.loading').hide(); }); //i have trouble with the post permiters so i always do it the {} way but you can just pass a array $.post('example.php',{peram1 : 'hello',peram2 : 'world', myval : $ ('.myinput').val()},function(data){ alert($(data).find('result').text()); }); }); if the return was xml ie it saved then you would get it saved in a alert watch some of the functions though if you tell it to expect something as it will just brake. .loading i am useing as your loading graphic or a div containing it etc using css to absolutely position it or putting it wherever you want it. you can do better things if you want but if you just trying things for the first time this will do :P On Sep 28, 10:58 am, mattastic wrote: > Could soneone please show me an example of a simple ajax post to a > coldfusion page, with a loading graphic? > > I cant find an appropriate example in the documentation. > > Thankyou
[jQuery] Re: Simple Jquery AJAX post
i did try ealer to send a reply but that did not seem to apper so heres a shorter version http://docs.jquery.com/Ajax has everything you need, to make a loading image come up on start you can just ether in your click function inlude $(".loading").show(); or use the event http://docs.jquery.com/Ajax/ajaxStart#callback then use the stop http://docs.jquery.com/Ajax/ajaxStop#callback then its just a $.post(url,data,callback) i normally do my data in a {} so {peram1 : 'test'} etc ending up with somthing like $.post ('example.php',{peram1 : 'test'},function(data){ alert('hello')}); On Sep 28, 10:58 am, mattastic wrote: > Could soneone please show me an example of a simple ajax post to a > coldfusion page, with a loading graphic? > > I cant find an appropriate example in the documentation. > > Thankyou
[jQuery] Sliding list items -- missing bullets?
I'm having issues with using slideUp/slideDown on lists; when list items reappear, their bullets are missing, both in Safari and Firefox. See example at: http://www.mnot.net/test/slide-list.html Is this a known issue? Thanks, -- Mark Nottingham http://www.mnot.net/
[jQuery] Buy or sell
We have great deals for Real Estate Investors. As real estate investors ourselves we are very eager to work with other real estate investors like you. http://www.greenmiraclesinc.com/inv.php?sysac=9&pg=26&tm=
[jQuery] Re: How to POST using jQuery?
Thanks for the ideas. Looks like it's not supported, which might be a symptom of bad design on my part. I just have lots of different actions, having a form for each one seemed messy. Maybe a suitable workaround would be to have a hidden form on the page, attach input elements to it as I need them, then finally call .submit on the form On Aug 12, 4:09 pm, Liam Potter wrote: > He's not using a form at all in this, I don't know why. > > Michael Price wrote: > > Is there any particular reason you HAVE to use Javascript to handle the form > > submission? If you want to redirect the user to another page after the form > > submission you may as well submit the form the normal way and use a server > > side redirect to send them on to the next page. > > > Failing that, you could make your form processing script return the next > > page in it's response, parse for this and then use it - is that feasible? > > > SUBMIT FORM > > PARSE RESPONSE WHICH WILL CONTAIN NEW PAGE URL IN IT > > > window.location = newPage; > > > Regards, > > Michael Price > > > -Original Message- > > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On > > Behalf Of Mark Smith > > Sent: 12 August 2009 16:02 > > To: jQuery (English) > > Subject: [jQuery] Re: How to POST using jQuery? > > > But then the page that gets served to the user with have no parameters > > posted to it. > > > On Aug 12, 3:50 pm, Liam Potter wrote: > > >> well, on the post callback, forward the browser to the page? > > >> window.location="/page.php" > > >> Mark Smith wrote: > > >>> Hi, > > >>> I know you can use jquery to post data from a json object ajaxly. > > >>> However I want to redirect the browser to the new page (like > >>> submitting a form) only passing the values explicitly from javascript > >>> rather than actually submitting a form. > > >>> Is this possible using jquery? > > >>> Thanks > >
[jQuery] Re: How to POST using jQuery?
But then the page that gets served to the user with have no parameters posted to it. On Aug 12, 3:50 pm, Liam Potter wrote: > well, on the post callback, forward the browser to the page? > > window.location="/page.php" > > Mark Smith wrote: > > Hi, > > > I know you can use jquery to post data from a json object ajaxly. > > > However I want to redirect the browser to the new page (like > > submitting a form) only passing the values explicitly from javascript > > rather than actually submitting a form. > > > Is this possible using jquery? > > > Thanks > >
[jQuery] How to POST using jQuery?
Hi, I know you can use jquery to post data from a json object ajaxly. However I want to redirect the browser to the new page (like submitting a form) only passing the values explicitly from javascript rather than actually submitting a form. Is this possible using jquery? Thanks
[jQuery] Re: JSON how to transform an object into an array?
yeah that i was thinking to but the problem is that you get. [object Object] if you alert out data again. On Aug 12, 11:53 am, Dhruva Sagar wrote: > I think this is what you are looking for > > data = eval ( '(' + data + ')' ); > > Thanks & Regards, > Dhruva Sagar. > > Jonathan > Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html> > - "May you live every day of your life." > > On Wed, Aug 12, 2009 at 3:18 PM, Mark wrote: > > > Hi all. > > I got an php page who picks up data out of my data base and puts it in > > a multidimensinal array. That array is being encoded to Json > > > $event = json_encode($super_array); > > > Then i made an javasript get funtion to get that array to my main > > page. > > > function get(){ > > $.get("../position of my file/test.php", function(data){ > > alert (""+data); > > }); > > > The var data doesn't give me an array it gives me an object while i > > programmed it to give me an array (inplace of force_object): > > > {"5": > > > {"id":"5","title":"test","start_datum":"6161616","end_datum":"663461","afspraak_type":"memo"},"10": > > > {"id":"10","title":"bla","start_datum":"4819028","end_datum":"8230948","afspraak_type":"verjaardag"}} > > > What i need to have is that it gives me an array that looks something > > like this: > > > [ > > { > > id:5, > > title:test, > > start_datum:6161616, > > end_datum: 663461, > > afspraak_type: Memo > > } > > { > > id:10, > > title:bla, > > start_datum: 4819028, > > end_datum:8230948, > > afspraak_type:Verjaardag > > } > > ] > > What is the best way to get to this? > > > Mark
[jQuery] JSON how to transform an object into an array?
Hi all. I got an php page who picks up data out of my data base and puts it in a multidimensinal array. That array is being encoded to Json $event = json_encode($super_array); Then i made an javasript get funtion to get that array to my main page. function get(){ $.get("../position of my file/test.php", function(data){ alert (""+data); }); The var data doesn't give me an array it gives me an object while i programmed it to give me an array (inplace of force_object): {"5": {"id":"5","title":"test","start_datum":"6161616","end_datum":"663461","afspraak_type":"memo"},"10": {"id":"10","title":"bla","start_datum":"4819028","end_datum":"8230948","afspraak_type":"verjaardag"}} What i need to have is that it gives me an array that looks something like this: [ { id:5, title:test, start_datum:6161616, end_datum: 663461, afspraak_type: Memo } { id:10, title:bla, start_datum: 4819028, end_datum:8230948, afspraak_type:Verjaardag } ] What is the best way to get to this? Mark
[jQuery] maskedinput plugin not cooperating with validate plugin?
My project uses jquery.maskedinput.js 1.2.2 and jquery.validate.js r6096. I'm looking at a date field, with a mask of 99/99/, which happens to also be required. If I focus and then blur on the required date field, validate fires (as it should), and does its required check, which (if I'm reading this properly) consists of a length check on the date textfield. Problem is, the 'value' of the date textfield is the format mask text itself, '__/__/', with a length of 10, so validation passes. Is there a prescribed way (short of my hacking jquery.validate.js) for validate and maskedinput to play nicely together? Say, for validate to return false if the required field's value matches the mask applied to it? I'm trying to use maskedinput's completed:function() to test and zap the data, but it's not firing properly just yet. Thanks much for any help / clarification / workarounds! Mark
[jQuery] Cannot "load" google API intensity map with jquery
Relatively inexperienced. I'm creating a dashboard using some of the Google visualizations. Want to do a selective refresh of certain pieces of the dashboard based on user action (rather than a full page reload). Was hoping to use jquery for this, but when I try to use in combination with the Google visualization (in this case, the intensity map) it just says "Transferring data from www.google.com..." and continues to run without completing. Any help would be greatly appreciated. Here is the code: http://www.w3.org/1999/xhtml"; > Test JQuery Div Load jQuery.noConflict(); jQuery(document).ready(function() { jQuery("#UsageMap").load("UsageMap.aspx"); }); This should get replaced with content from UsageMap.aspx
[jQuery] Re: error jquery-1.3.2.js(line 3633)
Ty just found it my self to and it works i think this topic is done ty for your help!! On Jul 8, 11:37 am, "Jonathan Vanherpe (T & T NV)" wrote: > This should stop the form from submitting (untested): > > $("f...@myform").submit(function() { > $.post('handler.php', { > > jaar:$('#jaar').val(), > maand:$('#maand').val(), > week:$('#week').val() > > }//, > //do_something(data) > ); > return false; > }); > > Jonathan > > > > Mark wrote: > > I used "$(document).ready(function() { > > $("from#myfrom").submit(function() {" > > now it doesn't give an error anymore so far i can see. > > So now only try to figure out how to post the value's with out the > > reload and then im going to make a callback to a new div and print the > > php array thereso i can go on form there > > > Thank you for your help so far now only hope and pray it will work > > > On Jul 8, 9:56 am, "Jonathan Vanherpe (T & T NV)" > > wrote: > >> Sorry, I didn't see your reply, this list is pretty high-traffic. > > >> I tried it, but it doesn't give me an error. The POST returns a 200 OK. > >> What I do notice is that after I click the button, I get a page reload, > >> so I think you need to put a 'return false;' in there somewhere to stop > >> the form from getting submitted. > > >> It's also a nice idea to use submit() instead of click(), to catch > >> people that use keyboard shortcuts and the like. > > >> so use: > >> $("form#myform").submit(function()... > >> instead of > >> $("button").click(function()... > > >> Jonathan > > >> Mark wrote: > >>> Can anybody find anything what i did wrong? > >>> the only code that is not commented out in the handler.php is > >>> >>> print_r($_POST); > >>> ?> > >>> To show me what kind of values it gets and how it looks in an array so > >>> i can make an associative of it. > >>> On Jul 7, 3:01 pm, Mark wrote: > >> -- > >> Jonathan Vanherpe - Tallieu & Tallieu NV - jonat...@tnt.be > > -- > Jonathan Vanherpe - Tallieu & Tallieu NV - jonat...@tnt.be
[jQuery] Re: error jquery-1.3.2.js(line 3633)
I used "$(document).ready(function() { $("from#myfrom").submit(function() {" now it doesn't give an error anymore so far i can see. So now only try to figure out how to post the value's with out the reload and then im going to make a callback to a new div and print the php array thereso i can go on form there Thank you for your help so far now only hope and pray it will work On Jul 8, 9:56 am, "Jonathan Vanherpe (T & T NV)" wrote: > Sorry, I didn't see your reply, this list is pretty high-traffic. > > I tried it, but it doesn't give me an error. The POST returns a 200 OK. > What I do notice is that after I click the button, I get a page reload, > so I think you need to put a 'return false;' in there somewhere to stop > the form from getting submitted. > > It's also a nice idea to use submit() instead of click(), to catch > people that use keyboard shortcuts and the like. > > so use: > $("form#myform").submit(function()... > instead of > $("button").click(function()... > > Jonathan > > > > Mark wrote: > > Can anybody find anything what i did wrong? > > the only code that is not commented out in the handler.php is > > > print_r($_POST); > > ?> > > To show me what kind of values it gets and how it looks in an array so > > i can make an associative of it. > > > On Jul 7, 3:01 pm, Mark wrote: > >>http://webserver.c4v.nl/mark/agenda%20nieuw/agenda.php for the > >> main filehttp://webserver.c4v.nl/mark/agenda%20nieuw/handler.php for > >> the > >> handlerhttp://webserver.c4v.nl/mark/agenda%20nieuw/agenda.css for the > >> csshttp://webserver.c4v.nl/mark/agenda%20nieuw/jquery-1.3.2.js for the > >> java sript librarie > > >> You can see all the files here and test what is going wrong. > >> (the notes u see in the handler.php are in dutch made for my > >> internship boss so hecan easy can see what i have done but he hasnt > >> time to help me time = money:s ) > > >> On Jul 7, 10:09 am, "Jonathan Vanherpe (T & T NV)" > >> wrote: > > >>> Mark wrote: > >>> Are you sure 'handler.php' exists? 'POST' isn't typically an error, > >>> unless the server returns a 404 or internal server error (500), in which > >>> case Firebug will show it in red. > >>> It would be nice if you uploaded your stuff somewhere (preferably > >>> reduced as a testcase). > >>> Jonathan > >>> -- > >>> Jonathan Vanherpe - Tallieu & Tallieu NV - jonat...@tnt.be > > -- > Jonathan Vanherpe - Tallieu & Tallieu NV - jonat...@tnt.be
[jQuery] Re: error jquery-1.3.2.js(line 3633)
Can anybody find anything what i did wrong? the only code that is not commented out in the handler.php is To show me what kind of values it gets and how it looks in an array so i can make an associative of it. On Jul 7, 3:01 pm, Mark wrote: > http://webserver.c4v.nl/mark/agenda%20nieuw/agenda.php for the > main filehttp://webserver.c4v.nl/mark/agenda%20nieuw/handler.php for the > handlerhttp://webserver.c4v.nl/mark/agenda%20nieuw/agenda.css for the > csshttp://webserver.c4v.nl/mark/agenda%20nieuw/jquery-1.3.2.js for the > java sript librarie > > You can see all the files here and test what is going wrong. > (the notes u see in the handler.php are in dutch made for my > internship boss so hecan easy can see what i have done but he hasnt > time to help me time = money:s ) > > On Jul 7, 10:09 am, "Jonathan Vanherpe (T & T NV)" > wrote: > > > Mark wrote: > > > I have 3 drop down menu's where is post the value's bij a button.click > > > (see code below). > > > But when i push the button i see an error in fire bug "POST" > > >http://localhost/agendanieuw/handler.php67ms jquery-1.3.2.js(line > > > 3633)" > > > I looked online for awnsers but couldn't find any. Maybe you guys can > > > help me. Here is my js code. > > > Are you sure 'handler.php' exists? 'POST' isn't typically an error, > > unless the server returns a 404 or internal server error (500), in which > > case Firebug will show it in red. > > > It would be nice if you uploaded your stuff somewhere (preferably > > reduced as a testcase). > > > Jonathan > > -- > > Jonathan Vanherpe - Tallieu & Tallieu NV - jonat...@tnt.be
[jQuery] Re: How to read the contents of .php filw on the webserver
var scrUrl; var Host = "http://www.example.com/read.php";; function inializeUrl() { scrUrl = Host //+ string //in de string komt de api key te staan maar omdat die niet standaard is maak ik er later een string van } function do_it() { inializeUrl(); var letitsee = document.getElementById("ID OF DIV WHERE IT HAS TO GO INTO\\"); letitsee.innerHTML = ""; } little script i have written today for a mail pakage service. I selected the things out of it what u need know you have only have to call the do_it function in your document now and make a div where it has to be printed in. ( ) On Jul 7, 9:19 am, Neha wrote: > Hey guys, > > Myself totally new in this javascript worldi have to read the > contents of a .php file which is placed on the webserver...say > (http>//www.example.com/read.php)...howto do that???
[jQuery] Re: error jquery-1.3.2.js(line 3633)
http://webserver.c4v.nl/mark/agenda%20nieuw/agenda.php for the main file http://webserver.c4v.nl/mark/agenda%20nieuw/handler.php for the handler http://webserver.c4v.nl/mark/agenda%20nieuw/agenda.css for the css http://webserver.c4v.nl/mark/agenda%20nieuw/jquery-1.3.2.js for the java sript librarie You can see all the files here and test what is going wrong. (the notes u see in the handler.php are in dutch made for my internship boss so hecan easy can see what i have done but he hasnt time to help me time = money:s ) On Jul 7, 10:09 am, "Jonathan Vanherpe (T & T NV)" wrote: > Mark wrote: > > I have 3 drop down menu's where is post the value's bij a button.click > > (see code below). > > But when i push the button i see an error in fire bug "POST" > >http://localhost/agendanieuw/handler.php 67ms jquery-1.3.2.js(line > > 3633)" > > I looked online for awnsers but couldn't find any. Maybe you guys can > > help me. Here is my js code. > > Are you sure 'handler.php' exists? 'POST' isn't typically an error, > unless the server returns a 404 or internal server error (500), in which > case Firebug will show it in red. > > It would be nice if you uploaded your stuff somewhere (preferably > reduced as a testcase). > > Jonathan > -- > Jonathan Vanherpe - Tallieu & Tallieu NV - jonat...@tnt.be
[jQuery] Re: error jquery-1.3.2.js(line 3633)
echo (" "); ?> knop Januari "; echo "$value"; echo ""; } } ?> On Jul 6, 4:59 pm, Eric Garside wrote: > Well, firebug shouldn't have cared as much as IE would, because of a > comma inside the list of params in your POST. The last element in an > object can't have a comma. > > Also, could you post the HTML? > > On Jul 6, 8:49 am, Mark wrote: > > > I have 3 drop down menu's where is post the value's bij a button.click > > (see code below). > > But when i push the button i see an error in fire bug > > "POST"http://localhost/agendanieuw/handler.php67ms jquery-1.3.2.js(line > > 3633)" > > I looked online for awnsers but couldn't find any. Maybe you guys can > > help me. Here is my js code. > > > </ > > script> > > <script type="text/ > > javascript"> > > > $(document).ready(function() { > > $("button").click(function() { > > $.post('handler.php', { > > > jaar:$('#jaar').val(),//jaar means year > > maand:$('#maand').val(),//maand means month > > week:$('#week').val(), > > > }) > > }); > > }); > >
[jQuery] error jquery-1.3.2.js(line 3633)
I have 3 drop down menu's where is post the value's bij a button.click (see code below). But when i push the button i see an error in fire bug "POST" http://localhost/agenda nieuw/handler.php 67ms jquery-1.3.2.js(line 3633)" I looked online for awnsers but couldn't find any. Maybe you guys can help me. Here is my js code. $(document).ready(function() { $("button").click(function() { $.post('handler.php', { jaar:$('#jaar').val(),//jaar means year maand:$('#maand').val(),//maand means month week:$('#week').val(), }) }); });
[jQuery] Validate
HI I am trying to use the Validate plugin for Jquery with .NET. I managed to work it out on one particular page. However I have a minor problem. Let's suppose you have a page with 2 Query tabs. In the first tab the user can add a Person which includes Name, Surname etc. In the other tab the user can add some Person History. Now in the first tab Person Name is required. So I create a validator on First Name on the first page and it works ok. In the second tab I create a required field on another field. Now the problem is that if Person Name is not empty, and the user clicks on Add in the second tab but the required field in the second tab is empty, the Validate() method will return true even though the field in the second tab is empty. Therefore I need to find a way how I can create a grouping validator for the first and second tab like what is in ASP.NET in which it enabled you to create a group so that when you validate you validate per group. I am using ASP.NET and I do not wish to crearte a button with its type as SUBMIT since I am using AJAX calls and I do not want to submit the form when the ADD button is clicked. Thanks
[jQuery] Re: Hide/show divs based on form parameters
Ah, I actually came across this page, but assumed it was built into jQuery and didn't notice it was a plug-in. It works now, thanks for making me read it properly :P On Jun 14, 3:37 am, Nitin Sawant wrote: > http://www.mathias-bank.de/2006/10/28/jquery-plugin-geturlparam/ > > On Jun 13, 8:37 pm, Mark wrote: > > > > > Hi all, > > > I'm trying to selectively hide and show divs based on what a user > > specifies using three select boxes in a form. > > > I'm quite new to jQuery so I'm probably missing something obvious, but > > here's what I've got and it doesn't, work, they divs just stay hidden. > > > Any help would be greatly appreciated! > > > > > > > > src="<a rel="nofollow" href="http://code.jquery.com/jquery-latest.js"">http://code.jquery.com/jquery-latest.js"</a>;> > > > > $(document).ready(function(){ > > $(".coursecontent").hide(); > > var area = $(document).getUrlParam("area"); > > var level = $(document).getUrlParam("level"); > > var time = $(document).getUrlParam("time"); > > $("." + area + "." + level + "." + time).show(); > > }); > > > > > > Javascript 'search' demo > > > > > > > > > Find a Course > > We have something for everyone! > > > > > style="outline: none"> > > Select Course > > area > > Any > > Barry > > Canton > > Cardiff > > Bay > > Cardiff > > Centre > > > value="cowbridge">Cowbridge > > > value="creigiau">Creigiau > > Ely > > > value="grangetown">Grangetown > > Gwaelod y > > Garth > > Llandaf > > > value="llanishen">Llanishen > > > value="llanrumney">Llanrumney > > Llantwit > > Major > > Penarth > > Pentwyn > > > value="pontprennau">Pontprennau > > > value="rhiwbina">Rhiwbina > > Roath > > Rumney > > Splott > > St > > Athan > > > value="whitchurch">Whitchurch > > Wick > > > > > > > > Select > > Course level > > Any > > > value="pre">Pre-entry/Taster > > Entry > > Entry > > & Foundation (Wlpan) > > > value="foundation">Foundation > > > value="intermediate">Intermediate > > Higher > > > value="proficiency">Proficiency/Fine-Tuning > option> > > > > > > > > Select > > Course time > > Any > > > value=&quo
[jQuery] Show/hide divs depending on form parameters
Hi all, I am pretty new to jQuery, and I'm looking for a way to kind of 'filter' divs depending on the parameters supplied by a form. I have three select boxes that set 'area', 'level', and 'time' parameters (for courses). I have given corresponding classes to some example divs, and I want the ones that match the parameters to be visible, and the rest to be hidden. Here is what I have got, but it doesn't work (they all stay no matter what parameters are supplied). Any help would be greatly appreciated! http://code.jquery.com/jquery-latest.js";> $(document).ready(function(){ $(".coursecontent").hide(); var area = $(document).getUrlParam("area"); var level = $(document).getUrlParam("level"); var time = $(document).getUrlParam("time"); $("." + area + "." + level + "." + time).show(); }); Javascript 'search' demo Find a Course We have something for everyone! Select Course area Any Barry Canton Cardiff Bay Cardiff Centre Cowbridge Creigiau Ely Grangetown Gwaelod y Garth Llandaf Llanishen Llanrumney Llantwit Major Penarth Pentwyn Pontprennau Rhiwbina Roath Rumney Splott St Athan Whitchurch Wick Select Course level Any Pre-entry/Taster Entry Entry & Foundation (Wlpan) Foundation Intermediate Higher Proficiency/Fine-Tuning Select Course time Any Morning Lunchtime Afternoon Evening Barry, Entry, Morning Canton, Entry, Evening Llanishen, Wlpan, Lunchtime Penarth, Foundation, Evening Splott, Higher, Evening
[jQuery] Hide/show divs based on form parameters
Hi all, I'm trying to selectively hide and show divs based on what a user specifies using three select boxes in a form. I'm quite new to jQuery so I'm probably missing something obvious, but here's what I've got and it doesn't, work, they divs just stay hidden. Any help would be greatly appreciated! http://code.jquery.com/jquery-latest.js";> $(document).ready(function(){ $(".coursecontent").hide(); var area = $(document).getUrlParam("area"); var level = $(document).getUrlParam("level"); var time = $(document).getUrlParam("time"); $("." + area + "." + level + "." + time).show(); }); Javascript 'search' demo Find a Course We have something for everyone! Select Course area Any Barry Canton Cardiff Bay Cardiff Centre Cowbridge Creigiau Ely Grangetown Gwaelod y Garth Llandaf Llanishen Llanrumney Llantwit Major Penarth Pentwyn Pontprennau Rhiwbina Roath Rumney Splott St Athan Whitchurch Wick Select Course level Any Pre-entry/Taster Entry Entry & Foundation (Wlpan) Foundation Intermediate Higher Proficiency/Fine-Tuning Select Course time Any Morning Lunchtime Afternoon Evening Barry, Entry, Morning Canton, Entry, Evening Llanishen, Wlpan, Lunchtime Penarth, Foundation, Evening Splott, Higher, Evening
[jQuery] Re: Plug-in to display (overlay) DIV element on the page at all times?
Thanks to all. I know that this can be done using CSS but dailylife.com uses JS, since disabling it disables the feedback tab. That's why I was wondering if there's a plug-in for jQuery that does the same.
[jQuery] Plug-in to display (overlay) DIV element on the page at all times?
Example: http://www.daylife.com/ (facebook tab on the left). Is anyone aware of a jQuery plug-in that would do something similar? Thanks.
[jQuery] Select box .show problem
Hi , I'm just trying jQuery out for the first time... Is this a bug in jQuery or am I doing something wrong? I am trying to chain together a bunch of drop down select boxes. Whenever I just use .hide() and .show() it works fine. But if I use .show("slow") it adds big gaps between some of the select boxes. I get the same result with both FF, IE and Safari. Example code is below. Any ideas? Thanks http://www.w3.org/ TR/html4/strict.dtd"> 1 2 3 1 2 3 1 2 3 1 2 3 $('#sel1').hide(); $('#sel2').hide(); $('#sel3').hide(); //$("#sel").ajaxAddOption("http://localhost:83/ajax/random";, null,false); $("#sel").change(function(event) { //$("#sel1").ajaxAddOption("http://localhost:83/ajax/ random", null, false); $('#sel1').show("slow"); $('#sel2').hide(); $('#sel3').hide(); }); $("#sel1").change(function(event) { //$("#sel2").ajaxAddOption("http://localhost:83/ajax/ random", null, false); $('#sel2').show("slow"); $('#sel3').hide(); }); $("#sel2").change(function(event) { //$("#sel3").ajaxAddOption("http://localhost:83/ajax/ random", null, false); $('#sel3').show("slow"); });
[jQuery] Re: Request: build hoverFlow in jquery core
On Tue, Jun 2, 2009 at 10:48 PM, Ralf Stoltze wrote: > > Hi Mark, > > First let me say that your request might be better suited for the > jquery-dev list. > > As the author of hoverFlow I'm not quite sure if and how hoverFlow > should be included in core. > > I think that hoverFlow doesn't solve a general problem with > animations, it solves a special issue that arises from the combination > of animation and mouse interaction (hovering). I think we have to wait > and see how frequent this problem comes up in order to qualify it for > core. > >> like for example that you can say to the animate >> function to run once and not build up the queue? > > It's not about running once, it's about running under certain > conditions. And these conditions are tied to the mouse events (that is > why hoverFlow requires you to pass in the event type as its first > argument). Currently I can't see how this could be best reflected in > the jQuery API (maybe adding the event type to the animation options > hash). > > I see that people don't really want to add another plugin to their > stack just to solve this litte problem. Many suggestions to overcome > animations buildup can be found on > http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup > (the post that inspired me to build the plugin). > > In many situations, variations of the stop()-method work quite well. > For submenu navigations, the solution presented at the bottom of > http://www.2meter3.de/code/hoverFlow/submenus.html is suitable. > However, most solutions fail with long animation durations. > > Ralf > Hi, i do like your plugin a lot! thanx for making that. About the mailing list. this used to be the jquery dev mailing list because this was the only list. I didn't know that there where more lists. As for including it to the core. Your plugin solved my issue and is probable the answer to every site that has the "issue" of animations queuing up. This plugin/solution is only required with mouse hovering thus the current jquery animation methods are indeed just fine. Perhaps a way of implementing it is when .hover() is used? because then you probably want to use your mouse anyway. i don't know it anymore. just adding this one file is fine right now.
[jQuery] Re: Request: build hoverFlow in jquery core
On Mon, Jun 1, 2009 at 9:46 PM, Mark wrote: > Hey, > > The biggest issue i always had with jquery was that queue build up stuff. > Now we have the hoverFlow plugin to fix that: > http://www.2meter3.de/code/hoverFlow/index.html > But i was wondering.. shouldn't this be part of the core? like for > example that you can say to the animate function to run once and not > build up the queue? > Also the ability hoverFlow provides seems to be something that really > should be in the core because everyone working with effects will > probably need it at some point in time. > > So that's why i request to make hoverFlow part of the jquery core. > > Just out of curiosity. What's the fastest way to imitate the hoverFlow > effect without adding that plugin? > i personally would rather avoid adding any more javascript plugins to > my site. one should be enough unless your doing extreme things. > No comments? suggestions? or just anything?
[jQuery] Request: build hoverFlow in jquery core
Hey, The biggest issue i always had with jquery was that queue build up stuff. Now we have the hoverFlow plugin to fix that: http://www.2meter3.de/code/hoverFlow/index.html But i was wondering.. shouldn't this be part of the core? like for example that you can say to the animate function to run once and not build up the queue? Also the ability hoverFlow provides seems to be something that really should be in the core because everyone working with effects will probably need it at some point in time. So that's why i request to make hoverFlow part of the jquery core. Just out of curiosity. What's the fastest way to imitate the hoverFlow effect without adding that plugin? i personally would rather avoid adding any more javascript plugins to my site. one should be enough unless your doing extreme things.
[jQuery] treeview - way to ignore a list from treeview
I am displaying some lists, and some of the list li's display user generated content. Some of that conetnt seems to have lists in them. Is there a way to specifically say that treeview should only process certain uls or lis and ignore others? e.g. my user list my user list a paragraph I'd like treeview to ignore the ul in the user content. TIA
[jQuery] Changing droppable accept or scope dynamically in the "drag" callback.
I've tried about everything and can't get the results I need. Basically I have some draggables in a movable div (pane). When I'm over the pane I only want the draggable to be droppable on elements in the pane (and have a visual cue as such). When I move beyond the pane I only want the draggable to be droppable on elements on a background div the size of the window behind the pane. Right now if I drop on a droppable in the pane and there is a droppable behind the pane they both get the drop call. I'm setting up the droppables in the "start" callback of the draggable. I've tried changing the accept on the droppables outside the pane in the "drag" callback, when the draggable crosses outside the pane boundary. I can't seem to change the accept on droppables dynamically from within the drag callback. They seem locked to the state when the drag first started. I've also tried changing the scope of the draggable (and also tried it on the droppables) from within the "drag" callback, when the draggable crosses outside the pane boundary. The scope doesn't seem to change dynamically when called from within the "drag" callback. They also seem locked to the state when the drag first started. I would really like the activeClass cue to change dynamically when I cross the pane boundary as well. Does anyone have any ideas as to how to make this work. Thanks, -ml
[jQuery] How to destroy a tooltip?
I'm using tooltips on a file list. When I delete a file (and it's DOM structure representation) that has a tooltip I'm getting an error at line 232. "setting(current) is undefined" if (event) { 231 // position the helper 15 pixel to bottom right, starting from mouse position 232 left = event.pageX + settings(current).left; 233 top = event.pageY + settings(current).top; 234 var right='auto'; 235 if (settings(current).positionLeft) { 236 right = $(window).width() - left; 237 left = 'auto'; 238 } 239 helper.parent.css({ 240 left: left, 241 right: right, 242 top: top 243 }); 244 } Is there any way to destroy the tooltip when I remove the DOM element that has the tooltip? Thanks, -ml
[jQuery] Re: Cluetip not working on multiple links calling local html data
Hi Karl, I'm having a similar issue as described in the original post here: - I have three divs that I want to use for cluetip: info-1, info-2, and info-3. - I have six links: two for each div. They all have the correct rel attributes set (two have rel="#info-1", and so on). - Only the first of the six links displays the correct content. While the rest of the cluetips do show up and they do have the right header, their content is empty. I tried the release you've posted here to no avail. I also tried using the method described above (setting the rel attribute to a class that's shared by all the divs and placing the divs after each link), but the cluetips don't display properly: the first three links show the first div, then the rest show none. Am I asking too much of cluetip? Or is there a different way to do this? Thanks, Mark Trapp On Apr 9, 7:21 pm, Karl Swedberg wrote: > Hi there Ian, > > So sorry about that problem. I believe I've fixed it in a version I've > had up on Github for a couple weeks. Just put together a new release > for it here: > > http://plugins.jquery.com/node/7526 > > Please give that one a try and let me know if you still run into > problems > > --Karl > > > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > On Apr 8, 2009, at 10:44 PM, Ian wrote: > > > > > > > Hi, > > > I'm pretty new to jquery, but I really love the cluetip plugin. I'm > > having trouble, though, when I define tips for a series of > > elements which each call different local html data. When I use the > > "rel" attribute to call distinct attribute values for the s > > holding the data (whether id or class), I only get data in the first > > cluetip. For the rest I get the tip but it's empty. > > > Here's the script in my : > > > $(document).ready(function() { > > $('a.load-local').cluetip({local:true, hideLocal: true, sticky: true, > > arrows: true, cursor: 'pointer'}); > > }); > > > And here's the html in the body: > > > hover here > > Here's some contenthere's > > another line. > > > hover here too > a> > > Here's some different content. > div> > > > hover here too > a> > > Here's some really > > different content. > > > If I use the "rel" attribute of all the links to call one common class > > for the data s then I get the appropriate data showing up in each > > tip. But then only the first data is hidden. All the rest in the > > series are left visible in the document body (as well as being cloned > > in the cluetip). > > > Here's the html I'm using in that case: > > > hover here > > Here's some contenthere's > > another line. > > > hover here too > > Here's some different content. > div> > > > hover here too > > Here's some really different > > content. > > > Am I doing something wrong? This is a trivial example, of course, but > > the principle applies to a larger web-app I'm working on. > > > Thanks, > > > Ian
[jQuery] Superfish on roids second top level row problem (z-index?)
hello, I want to use this menu but i have so many main items that there are 2 rows. The first row is always on top. How can i get the second level menu to be on top of the fisrt item menu-item1 menu-item2 menu-item3 menu-item4 menu-item5 menu-item6 menu-item7 menu-item8 menu-item9
[jQuery] Re: Form validation plugin
i have major trouble to get the form validation plugin from Jörg to run it seems like it cannot deal with forms coming from a framework like CAKEPHP the fields are build the following by cake: well, now this plugin seems to ignore the id tags and use the name tag instead but it has trouble with the [ ] brackets if i set up the form fields manually, it works fine is there some way of getting this fixed? thx On 17 Apr., 22:15, Rick wrote: > I bet you're just missing a comma or something somewhere.. > > On Apr 17, 1:11 pm, koolkat wrote: > > > When I tried it on 1.3.2, the messages displayed briefly but then the > > form submitted. Is there some other change I need to make? Thanks. > > > On Apr 15, 11:59 pm, Jörn Zaefferer > > wrote: > > > > The current validation plugin works fine with both 1.2.6 and 1.3.2. > > > > Jörn > > > > On Thu, Apr 16, 2009 at 1:48 AM,koolkat wrote: > > > > > I have been using the form validation plugin with jquery 1.2.6. I > > > > would like to use the new jquery version 1.3.2 but was wondering if > > > > there is a replacement validation plugin for this version or if it > > > > could be made to work. > > > > > Thank you.
[jQuery] Superfish - Bug with fix
There is an issue in the comparison of the computed string lengths and the min and max values because they are being compared as string instead of floats. The following code needs to be change from... if (emWidth > o.maxWidth) { emWidth = o.maxWidth; } else if (emWidth < o.minWidth) { emWidth = o.minWidth; } to... if ((emWidth * 1) > (o.maxWidth * 1)) { emWidth = o.maxWidth; } else if ((emWidth * 1) < (o.minWidth * 1)) { emWidth = o.minWidth; } Works great with that fix. Thanks for a great script. Mark
[jQuery] Can't get ActiveX custom event in IE using jQuery
Hello, I have a handler for a custom ActiveX control event that I can successfully register for in IE using the following code: this.activeXObj.attachEvent("PlayerInitialized", this.handlerFunc); When I use the code above I get the event in my handler. I am now trying to use jQuery to attach the event handler like this: $(this.activeXObj).bind("PlayerInitialized", this.handlerFunc); With the jQuery code I never receive the event. Can anyone tell me what I am doing wrong? Thanks, Mark
[jQuery] Re: [validate] grouped select boxes
I did this in the end (created a div called errorcontainer obviously). $(document).ready(function(){ var container = $("#errorcontainer"); container.hide(); $("#regform").validate({ submitHandler: function(form) { if ($("#seasonmember").val()=="0" && $("#season").val()=="0") { container.show(); } else { form.submit(); } } }); }); On Mar 11, 6:13 pm, Jörn Zaefferer wrote: > Using the validation plugin, set a required-rule for each field, after > removing the value from the 0-option, that is, change it to value"">0 > > Jörn > > On Wed, Mar 11, 2009 at 6:57 AM, Mark King wrote: > > > Hi. > > > I have two select boxes for differrent classes of tickets , like so: > > > > > 0 > > 1 > > 2 > > 3 > > 4 > > 5 > > > > > 0 > > 1 > > 2 > > 3 > > 4 > > 5 > > > > > I want to validate that at least one ticket has been purchased. I > > would like to try to do this with the validate plugin, more for the > > purposes of R&D than anything else (I could write some code to just > > add up the values, but that's not really the point). > > > How would I go about doing this? > > > Thanks, > > Mark
[jQuery] Re: [validate] grouped select boxes
I did this in the end (created a div called errorcontainer obviously). $(document).ready(function(){ var container = $("#errorcontainer"); container.hide(); $("#regform").validate({ submitHandler: function(form) { if ($("#seasonmember").val()=="0" && $("#season").val()=="0") { container.show(); } else { form.submit(); } } }); }); On Mar 11, 6:13 pm, Jörn Zaefferer wrote: > Using the validation plugin, set a required-rule for each field, after > removing the value from the 0-option, that is, change it to value"">0 > > Jörn > > On Wed, Mar 11, 2009 at 6:57 AM, Mark King wrote: > > > Hi. > > > I have two select boxes for differrent classes of tickets , like so: > > > > > 0 > > 1 > > 2 > > 3 > > 4 > > 5 > > > > > 0 > > 1 > > 2 > > 3 > > 4 > > 5 > > > > > I want to validate that at least one ticket has been purchased. I > > would like to try to do this with the validate plugin, more for the > > purposes of R&D than anything else (I could write some code to just > > add up the values, but that's not really the point). > > > How would I go about doing this? > > > Thanks, > > Mark
[jQuery] [validate] grouped select boxes
Hi. I have two select boxes for differrent classes of tickets , like so: 0 1 2 3 4 5 0 1 2 3 4 5 I want to validate that at least one ticket has been purchased. I would like to try to do this with the validate plugin, more for the purposes of R&D than anything else (I could write some code to just add up the values, but that's not really the point). How would I go about doing this? Thanks, Mark
[jQuery] clone of an element to be dropped draggable
hi i want to a clone of an element to be dropped and dragged. i am using the standard jquery 1.3 and jquery ui 1.7. i tried the helper clone option. it creates a clone when dragged, but when it is dropped it just reverts back to the original position. but i want a clone also to be dropped. for example: http://jqueryui.com/demos/draggable/revert.html i tried this demo with revert set to false. but still a clone is not dropped. thanks a lot!
[jQuery] Re: [Validate] Modifying validate options after page load.
Yup that worked after I got the scoping right $('#myButton').click(function(){ var validator = $("#myForm").validate(); validator.settings.submitHandler = function() {alert('new submithandler involed');}; }); Thanks Jorn. Mark On Mar 6, 12:39 pm, Jörn Zaefferer wrote: > Try this: > > var validator = $("#myform").validate(...); > $(".button").click(function() { > validator.settings.submitHandler = function() { ... }; > > }); > > Jörn > > On Fri, Mar 6, 2009 at 1:02 PM, Mark Perry wrote: > > > Hi > > > This is a strange question I know but I would like to modify the > > validate options to my form based on a click of a button. For example > > my default onload code sets up the .validateI() class with my options > > then based on a user clicking a button I want to override the > > "submitHandler" options with some new code. > > > so in short: > > > $(document).ready(function(){ > > $('#form').validate(); > > }); > > > function changevalidateoptions() > > { > > //Set my new options here > > } > > > Thanks, Mark
[jQuery] [Validate] Modifying validate options after page load.
Hi This is a strange question I know but I would like to modify the validate options to my form based on a click of a button. For example my default onload code sets up the .validateI() class with my options then based on a user clicking a button I want to override the "submitHandler" options with some new code. so in short: $(document).ready(function(){ $('#form').validate(); }); function changevalidateoptions() { //Set my new options here } Thanks, Mark
[jQuery] Re: jQuery.validate not working properly?
Ah, I totally forgot to reply to this. This fixed the problem, thank you so much! Mark On Feb 15, 5:18 am, Jörn Zaefferer wrote: > The minLength doesn't exist, its minlength. What happens is that an > error as thrown, and instead of stopping the submit, it just submits. > To debug issues like this, you can set debug:true - it'll then always > prevent a submit, valid or not. > > Jörn > > On Sun, Feb 15, 2009 at 1:24 AM, Mark wrote: > > > If I leave all the fields blank, the errors show up as they should. > > But if I correctly fill out even just one of them, the form gets > > submitted. Why is this happening? > > > Here's the JS: > > > > > $(document).ready(function() { > > $("form").validate({ > > rules: { > > email: { > > required: true, > > email: true > > }, > > fname: { > > required: true, > > minLength: 2 > > }, > > lname: { > > required: true, > > minLength: 2 > > }, > > city: { > > required: true, > > minLength: 2 > > }, > > password1: { > > required: true, > > minLength: 6 > > }, > > password2: { > > equalTo: "#password1" > > } > > }, > > messages: { > > email: "*", > > fname: "*", > > lname: "*", > > city: "*", > > password1: "*", > > password2: "*" > > } > > }); > > }); > > > > > The page is visible here:http://whitechocolateent.com/register
[jQuery] Re: iterate through form elements, wait for post to finish and continue
Actually sorry the values should be: 2009-01-04 2009-01-07 2009-01-10
[jQuery] iterate through form elements, wait for post to finish and continue
I have the following inputs The idea is that I have a php script that calculates the date by building upon the values that are passed into it. So in the (a|b|c)_preview span the expected values would be something like: 2009-01-04 2009-01-05 2009-01-06 I then tried to do something like the following: $(document).ready(function(){ $("#assign").click(function() { $(".interval").each( function() { // save current var previewId = $(this).attr("rel"); //alert( previewId ); if( $("#" + $("#previousStartDate").val()).val() ! = '' && $("#" + $("#previousStartDate").val()).val() != null) { var startDate = $("#" + $ ("#previousStartDate").val() ).html(); } else { var startDate = $("#start_date").val(); } alert( '0-'+previewId); $.post("/scripts/admin.course.php? action=calculateDate", {startDate: startDate, nextDate: $(this).val ()},function(data){ $("#" + previewId).html(data); alert( 'i-'+previewId ); // save what the previous start date field id is $("#previousStartDate").val($(this).attr ("rel") ); }); }); }) }) What happens (which from what I read is expected) is that I get all of the "O-" alerts and then I get all of the "I-" alerts. So the dates aren't built upon each other. What would be a good way to re-do this function so that it waits for the previous value before continuing on.
[jQuery] How to use multiple versions of jQuery
Hi, I've written an article and small bit of support code to aid in the use of multiple versions of jQuery (and possibly other) JS libraries in a page: Docs: https://www.adaptavist.com/display/~mgibson/Using+multiple+versions+of +javascript+libraries Code: http://test3.internal.adaptavist.net/~mgibson/versions/ I'd be interested in feedback on this: * Can you foresee any problems with this technique? * Would it work for any other of the major JS libraries? * Should I put it somewhere on jquery.com? * Would a google.load style version matching algorithm be worthwhile? * Any other suggestions? Regards - Mark Gibson
[jQuery] Re: how to zebra stripe divs?
Great Scott! you are right, it is working now :) Many thanks indeed everyone you are all legends!, I shall write this up in my blog, thanks again :) 2009/2/17 Ricardo Tomasi > > The code in your test page still reads $("div:.postSummary > (odd)").addClass("odd"), not $("div.postSummary:odd").addClass("odd"); > > On Feb 17, 12:04 am, mark law wrote: > > Thanks MorningZ :), yes that is the one I'm trying to mimic. "odd" is > only > > declared in: > > > > $("div.postSummary-teaser:odd").addClass("odd"); > > > > Where else should it be? I was hoping this code would just add it to > > alternate divs with a class of "postSummary-teaser" > > > > The html is actually: > > > > > > > > > > > > > > title > > Posted by: > class="author-link">author name in label here on > > date here > > > > > > > > > > > > > > html of teaser text goes here > > > > > > > > class="postSummary-comments">link > > to comments > > > > > class="postSummary-readmore">Read More... > > > > > > > > > > > > > > > > > > > > > > then it repeats itself if there are more posts. I now realise I should be > > using postSummery not postSummary-teaser, I made the change. I just tried > it > > in a static page with nothing else in it just to make sure there are no > > conflicts. > > > > It still does not work though: > http://www.digiflipconcepts.com/digiflip-v3/templates/digiflip/test.html > > > > :( ? > > > > 2009/2/17 MorningZ > > > > > > > > > so this is the jQuery you are trying to mimic? > > > > > $("tr:nth-child(odd)").addClass("odd"); > > > > > ?? > > > > > that uses current selector syntax (http://docs.jquery.com/Selectors/ > > > nthChild#index <http://docs.jquery.com/Selectors/%0AnthChild#index>), > and > > > would indeed work on > > > > > > > > > > >Row 1 > > > > > > > > >Row 2 > > > > > > > > >Row 3 > > > > > > > > >Row 4 > > > > > > > > > > > If you had > > > > > Teaser 1 > > > Teaser 2 > > > Teaser 3 > > > Teaser 4 > > > Teaser 5 > > > > > then, there's no reason why > > > > > $("div.postSummary-teaser:odd").addClass("odd"); > > > > > wouldn't give zebra stripes (as long as class name "odd" is declared > > > somewhere) > > > > > On Feb 16, 9:09 pm, mark law wrote: > > > > I copied it from here: > > >http://blog.jquery.com/2006/10/18/zebra-table-showdown/andtried > > > > unsuccessfully to modify it for div classes ... > > > > > > 2009/2/17 MorningZ > > > > > > > I'm just curious... where are you getting your syntax from? > > > > > > > "div:.postSummary" > > > > > > > ".postSummary-teaser(odd)" ?? > > > > > > > there's now where in the documentation (http://docs.jquery.com) > where > > > > > that syntax is shown > > > > > > > On Feb 16, 6:31 pm, morktron wrote: > > > > > > Hi I'm just wondering whether it is possible to zebra stripe > > > alternate > > > > > divs > > > > > > with the same class name? > > > > > > > > The class name is .postSummary-teaser, I tried this: > > > > > > > > > > > > > > window.onload = function(){ > > > > > > $("div:.postSummary-teaser(odd)").addClass("odd");}; > > > > > > > > > > > > > > > > but no joy. I'm no Javascript programmer but it was easy to > stripe > > > > > alternate > > > > > > rows with a tutorial on the jQuerey site. There seems to be > nothing > > > about > > > > > > using divs? > > > > > > > > The page in question is in development here: > > > > >http://www.digiflipconcepts.com/digiflip-v3/Rant-and-Rave > > > > > > > > Can anyone help? thanks > > > > > > -- > > > > > > View this message in context: > > > > > > http://www.nabble.com/how-to-zebra-stripe-divs--tp22048135s27240p2204. > > > .. > > > > > > Sent from the jQuery General Discussion mailing list archive at > > > > > Nabble.com. >
[jQuery] Re: how to zebra stripe divs?
Thanks MorningZ :), yes that is the one I'm trying to mimic. "odd" is only declared in: $("div.postSummary-teaser:odd").addClass("odd"); Where else should it be? I was hoping this code would just add it to alternate divs with a class of "postSummary-teaser" The html is actually: title Posted by: author name in label here on date here html of teaser text goes here link to comments Read More... then it repeats itself if there are more posts. I now realise I should be using postSummery not postSummary-teaser, I made the change. I just tried it in a static page with nothing else in it just to make sure there are no conflicts. It still does not work though: http://www.digiflipconcepts.com/digiflip-v3/templates/digiflip/test.html :( ? 2009/2/17 MorningZ > > so this is the jQuery you are trying to mimic? > > $("tr:nth-child(odd)").addClass("odd"); > > ?? > > that uses current selector syntax (http://docs.jquery.com/Selectors/ > nthChild#index <http://docs.jquery.com/Selectors/%0AnthChild#index>), and > would indeed work on > > > >Row 1 > > >Row 2 > > >Row 3 > > >Row 4 > > > > If you had > > Teaser 1 > Teaser 2 > Teaser 3 > Teaser 4 > Teaser 5 > > then, there's no reason why > > $("div.postSummary-teaser:odd").addClass("odd"); > > wouldn't give zebra stripes (as long as class name "odd" is declared > somewhere) > > > > On Feb 16, 9:09 pm, mark law wrote: > > I copied it from here: > http://blog.jquery.com/2006/10/18/zebra-table-showdown/and tried > > unsuccessfully to modify it for div classes ... > > > > 2009/2/17 MorningZ > > > > > > > > > I'm just curious... where are you getting your syntax from? > > > > > "div:.postSummary" > > > > > ".postSummary-teaser(odd)" ?? > > > > > there's now where in the documentation (http://docs.jquery.com) where > > > that syntax is shown > > > > > On Feb 16, 6:31 pm, morktron wrote: > > > > Hi I'm just wondering whether it is possible to zebra stripe > alternate > > > divs > > > > with the same class name? > > > > > > The class name is .postSummary-teaser, I tried this: > > > > > > > > > > window.onload = function(){ > > > > $("div:.postSummary-teaser(odd)").addClass("odd");}; > > > > > > > > > > > > but no joy. I'm no Javascript programmer but it was easy to stripe > > > alternate > > > > rows with a tutorial on the jQuerey site. There seems to be nothing > about > > > > using divs? > > > > > > The page in question is in development here: > > >http://www.digiflipconcepts.com/digiflip-v3/Rant-and-Rave > > > > > > Can anyone help? thanks > > > > -- > > > > View this message in context: > > >http://www.nabble.com/how-to-zebra-stripe-divs--tp22048135s27240p2204. > .. > > > > Sent from the jQuery General Discussion mailing list archive at > > > Nabble.com. >
[jQuery] Re: how to zebra stripe divs?
I copied it from here: http://blog.jquery.com/2006/10/18/zebra-table-showdown/ and tried unsuccessfully to modify it for div classes ... 2009/2/17 MorningZ > > I'm just curious... where are you getting your syntax from? > > "div:.postSummary" > > ".postSummary-teaser(odd)" ?? > > there's now where in the documentation (http://docs.jquery.com) where > that syntax is shown > > > On Feb 16, 6:31 pm, morktron wrote: > > Hi I'm just wondering whether it is possible to zebra stripe alternate > divs > > with the same class name? > > > > The class name is .postSummary-teaser, I tried this: > > > > > > window.onload = function(){ > > $("div:.postSummary-teaser(odd)").addClass("odd");}; > > > > > > > > but no joy. I'm no Javascript programmer but it was easy to stripe > alternate > > rows with a tutorial on the jQuerey site. There seems to be nothing about > > using divs? > > > > The page in question is in development here: > http://www.digiflipconcepts.com/digiflip-v3/Rant-and-Rave > > > > Can anyone help? thanks > > -- > > View this message in context: > http://www.nabble.com/how-to-zebra-stripe-divs--tp22048135s27240p2204... > > Sent from the jQuery General Discussion mailing list archive at > Nabble.com. >
[jQuery] Re: how to zebra stripe divs?
Thanks Stephen, I suppose it's usually only doctors who say "your colon is in the wrong place" ;), unfortunately it still doesn't work :(, I appreciate your help though 2009/2/17 aquaone > your colon is in the wrong place. (how often does one get to say that?) > $("div.postSummary-teaser:odd").addClass("odd"); > > stephen > > > > On Mon, Feb 16, 2009 at 15:31, morktron wrote: > >> >> >> Hi I'm just wondering whether it is possible to zebra stripe alternate >> divs >> with the same class name? >> >> The class name is .postSummary-teaser, I tried this: >> >> >> window.onload = function(){ >>$("div:.postSummary-teaser(odd)").addClass("odd"); >> }; >> >> >> but no joy. I'm no Javascript programmer but it was easy to stripe >> alternate >> rows with a tutorial on the jQuerey site. There seems to be nothing about >> using divs? >> >> The page in question is in development here: >> http://www.digiflipconcepts.com/digiflip-v3/Rant-and-Rave >> >> Can anyone help? thanks >> -- >> View this message in context: >> http://www.nabble.com/how-to-zebra-stripe-divs--tp22048135s27240p22048135.html >> Sent from the jQuery General Discussion mailing list archive at >> Nabble.com. >> >> >
[jQuery] Append images to div from JSON
I am trying to append images to a div from a json file, but a don't see the images. They look broken, but the references are ok. What is wrong here? http://www.sionvalais.com/v2/js/ jq.js"> $(document).ready(function(){ $.getJSON("http://www.sionvalais.com/social/json.php";, function(data){ $.each(data.items, function(i,item){ $("").attr("src", item.cam).appendTo("#images"); if ( i == 3 ) return false; }); }); }); img{ height: 100px; float: left; } #images { width:500px; height:200px; }
[jQuery] jQuery.validate not working properly?
If I leave all the fields blank, the errors show up as they should. But if I correctly fill out even just one of them, the form gets submitted. Why is this happening? Here's the JS: $(document).ready(function() { $("form").validate({ rules: { email: { required: true, email: true }, fname: { required: true, minLength: 2 }, lname: { required: true, minLength: 2 }, city: { required: true, minLength: 2 }, password1: { required: true, minLength: 6 }, password2: { equalTo: "#password1" } }, messages: { email: "*", fname: "*", lname: "*", city: "*", password1: "*", password2: "*" } }); }); The page is visible here: http://whitechocolateent.com/register
[jQuery] Re: Prepended row, slide-in, showing only first cell
Follow up question, if I instead wanted to use multiple table cells instead of one big colspan, is there a way to do this same sort of thing without a div? On Feb 12, 11:35 pm, mkmanning wrote: > That should read "..first-child of its parent,.." in the first > sentence > > On Feb 12, 11:33 pm, mkmanning wrote: > > > Actually, Mark's use of 'first-child' is correct. ':first-child' is > > used to indicate the the element is the first-child its parent, not > > the parent element's first-child. The tr has a class of .ajax, and > > since it's prepended to the tbody, it is the first-child of the tbody, > > so the correct selector to get it would in fact be '.ajax:first- > > child'; you could also use '#recent_activity tbody tr:first-child' > > which means the same thing. > > > The problem you're having with the display once you call the slideDown > > () and fadeIn() functions is that they apply a style of > > 'display:block' to the table row, which results in the td not spanning > > other table cells like you'd expect. You need to put a div inside the > > td and use the slideDown() and fadeIn() functions on that. > > > If you want a very 'jQuery' chaining approach, try this: > > > $('').css('display','none').text('Testing this func').appendTo($ > > ('').attr('colspan','7').appendTo($('').prependTo > > ('#recent_activity tbody'))).slideDown('slow').fadeIn('slow'); > > > On Feb 12, 6:51 pm, James wrote: > > > > That's probably because you're using the "first-child" of the , > > > which is just the first . > > > Maybe you intended to do: > > > $(".ajax").slideDown('slow') > > > ? > > > > I'm not sure of its effects for a tr though compared to a div. > > > > On Feb 12, 4:43 pm, Mark Steudel wrote: > > > > > I have a table that is setup with a tbody tag. > > > > > If I run the following: > > > > > $("#recent_activity tbody").prepend( ' > > > colspan="7">Testing this func' ); > > > > > I get a new row spanning 7 columns > > > > > If I prepend this: > > > > $("#recent_activity tbody").prepend( ' > > > class="ajax">Testing this func' ); > > > > > Then try to show it, with something like: > > > > $(".ajax:first-child").slideDown('slow').fadeIn('slow'); > > > > > I only get the first cell showing up. Why does this happen?
[jQuery] Re: Prepended row, slide-in, showing only first cell
Thanks I'll give that a shot! On Feb 12, 11:35 pm, mkmanning wrote: > That should read "..first-child of its parent,.." in the first > sentence > > On Feb 12, 11:33 pm, mkmanning wrote: > > > Actually, Mark's use of 'first-child' is correct. ':first-child' is > > used to indicate the the element is the first-child its parent, not > > the parent element's first-child. The tr has a class of .ajax, and > > since it's prepended to the tbody, it is the first-child of the tbody, > > so the correct selector to get it would in fact be '.ajax:first- > > child'; you could also use '#recent_activity tbody tr:first-child' > > which means the same thing. > > > The problem you're having with the display once you call the slideDown > > () and fadeIn() functions is that they apply a style of > > 'display:block' to the table row, which results in the td not spanning > > other table cells like you'd expect. You need to put a div inside the > > td and use the slideDown() and fadeIn() functions on that. > > > If you want a very 'jQuery' chaining approach, try this: > > > $('').css('display','none').text('Testing this func').appendTo($ > > ('').attr('colspan','7').appendTo($('').prependTo > > ('#recent_activity tbody'))).slideDown('slow').fadeIn('slow'); > > > On Feb 12, 6:51 pm, James wrote: > > > > That's probably because you're using the "first-child" of the , > > > which is just the first . > > > Maybe you intended to do: > > > $(".ajax").slideDown('slow') > > > ? > > > > I'm not sure of its effects for a tr though compared to a div. > > > > On Feb 12, 4:43 pm, Mark Steudel wrote: > > > > > I have a table that is setup with a tbody tag. > > > > > If I run the following: > > > > > $("#recent_activity tbody").prepend( ' > > > colspan="7">Testing this func' ); > > > > > I get a new row spanning 7 columns > > > > > If I prepend this: > > > > $("#recent_activity tbody").prepend( ' > > > class="ajax">Testing this func' ); > > > > > Then try to show it, with something like: > > > > $(".ajax:first-child").slideDown('slow').fadeIn('slow'); > > > > > I only get the first cell showing up. Why does this happen?
[jQuery] Prepended row, slide-in, showing only first cell
I have a table that is setup with a tbody tag. If I run the following: $("#recent_activity tbody").prepend( 'Testing this func' ); I get a new row spanning 7 columns If I prepend this: $("#recent_activity tbody").prepend( 'Testing this func' ); Then try to show it, with something like: $(".ajax:first-child").slideDown('slow').fadeIn('slow'); I only get the first cell showing up. Why does this happen?
[jQuery] [validate] at least one of four fields
I have a form with four text fields where one must be completed - then each has their own validation rules (so if a field is not blank it must validate, but it can be blank as long as at least one other is completed). How can I code this using the validate plugin?
[jQuery] Re: Get contents of first child tr, td with class
Thanks, though that didn't work for me, though it could be more my page doesn't match my example totally. Though I did just come up with this, and this seems to work: $('.activity_date:first').html() ; On Feb 12, 11:21 am, James wrote: > $("#recent_activity tbody tr td.date:first").text(); > > On Feb 12, 9:13 am, Mark Steudel wrote: > > > I have a table like so: > > > > > > > > > t1 > > t2 > > > > > > > > > > value > > 2008-09-01 <--- want this content > > > > > > value > > 2008-09-01 > > > > > > > > > And I want to try and get the first td with class date, I've tried the > > following and I get close, but I think I'm just missing something > > easy: > > > $('#recent_activity tbody:first-child .activity_date').val(); <-- > > returns undefined > > > or > > > $('#recent_activity tbody:first-child .activity_date').html(); <-- > > returns null > > > Thoughts? Better way? > > > Thanks
[jQuery] Get contents of first child tr, td with class
I have a table like so: t1 t2 value 2008-09-01 <--- want this content value 2008-09-01 And I want to try and get the first td with class date, I've tried the following and I get close, but I think I'm just missing something easy: $('#recent_activity tbody:first-child .activity_date').val(); <-- returns undefined or $('#recent_activity tbody:first-child .activity_date').html(); <-- returns null Thoughts? Better way? Thanks
[jQuery] Re: Getting data from the corresponding column. (HTML Table with thead and tbody section.)
To make this example more readable, and to better convey my goal, I've restructured the CSS and HTML. Only the green area is click able (as it should be, the red area does not have a bound click even for a reason). When I click any part of the green area, I would like to get the value from the table head from the blue area in the corresponding column. http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"> Example Table table, thead, tbody, tfoot, tr, th, td { border-collapse: collapse; border: 1px SOLID; padding: 10px 10px 10px 10px; font: 12px Arial; } thead th {background: #FAA;} thead td {background: #AAF;} tbody th {background: #FCC;} tbody td {background: #CFC;} tbody tr.odd th {background: #FAA;} tbody tr.odd td {background: #AFA;} http://jqueryjs.googlecode.com/files/jquery-1.3.1.min.js"; type="text/javascript"> $(document).ready(function() { $("tbody td").click(function(e) { var innerHTML = $(this).get(0).innerHTML; alert(innerHTML); }); $("tbody tr:odd").addClass('odd'); }); tHead-1AtHead-1BtHead-1CtHead-1D tBody-1AtBody-1BtBody-1CtBody-1D tBody-2AtBody-2BtBody-2CtBody-2D tBody-3AtBody-3BtBody-3CtBody-3D tBody-4AtBody-4BtBody-4CtBody-4D Title: Example Table tHead-1AtHead-1BtHead-1CtHead-1D tBody-1AtBody-1BtBody-1CtBody-1D tBody-2AtBody-2BtBody-2CtBody-2D tBody-3AtBody-3BtBody-3CtBody-3D tBody-4AtBody-4BtBody-4CtBody-4D
[jQuery] Jquery seems to be sending two requests the first few times. . .
I have been tracing this one down for two days. Has anyone else ever seen jquery making multiple request for a single call? Here is the call: $("#configure_blocks").load( "config_templates/"+config_template +".html", { bust: new Date() }, function( data ){ var theform = document.getElementById("basic_properties"); theform.reset(); }); Here are the lines from my apache2 log: 10.0.1.12 - - [09/Feb/2009:11:41:21 -0800] "POST /config_templates/ led.html HTTP/1.1" 200 3035 "http://10.0.1.190/"; "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9) Gecko/2008061712 Firefox/3.0" 10.0.1.12 - - [09/Feb/2009:11:41:21 -0800] "GET /config_templates/ led.html HTTP/1.1" 200 3035 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9) Gecko/2008061712 Firefox/3.0" This has been driving me mad as I can't get a handle on why this is happening. As well, is it ok to make a second ajax call in the completion block of a previous ajax call? $("#configure_blocks").load( "config_templates/"+config_template +".html", { bust: new Date() }, function( data ){ var theform = document.getElementById("basic_properties"); theform.reset(); $.get("/cgi-bin/socket.cgi", { socket:'led', command:"off", plain: 1 }, function( json ){ alert( dump( json ); }, json ); }); Thanks, ml
[jQuery] Re: Using $_POST to transmit large key/pair
ah, I thought that { key : pair } was just a replacement for &key=pair... On Jan 30, 2:25 pm, Beres Botond wrote: > As shown in the docs (link I gave you), it should work > > $.post("order_send_email.php", > {order_message : order_message}, // {key : variable} > function(data) > { > alert(data); > // do something > }); > > On Jan 30, 4:03 pm, Mark Livingstone wrote: > > > > > Thanks, Beres. > > > I am reading this order_message from a DIV. How do I 'POST' it? By > > using form? > > > Also, to url encode... do I use "escape()"? > > > On Jan 30, 3:08 am, Beres Botond wrote: > > > > You want to use POST, but you are sending your data as GET (without > > > url encoding). > > > So I'm pretty sure it cuts before "#", because # is a non-alphanumeric > > > character and you haven't urlencoded your data. > > > > Data in URL = GET, not POST, even if you are using $.post . > > > >http://docs.jquery.com/Post > > > > So either urlencode your data before putting it in the request or send > > > it as POST. > > > > Also I'm not sure how it worked for you on server-side, if you were > > > expecting $_POST... I assume you were expecting > > > $_REQUEST instead, which is not a good idea in my opinion. > > > > On Jan 30, 8:08 am, Mark Livingstone wrote: > > > > > I have the following code: > > > > > $.post(order_send_email.php?order_message='+order_message) > > > > > my 'order_message' is: > > > > > 'Dear '+data['salutation']+" "+data['first_name']+" "+data['last_name'] > > > > +', \n\nThis is to inform you that your order #'+key+" and payment in > > > > the amount of...'; > > > > > When using $.POST... the message gets cut before "#". Is there a limit > > > > on how much cam be transmitted or am I doing something wrong? > > > > > Thanks.- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text -
[jQuery] Re: Using $_POST to transmit large key/pair
Thanks, Beres. I am reading this order_message from a DIV. How do I 'POST' it? By using form? Also, to url encode... do I use "escape()"? On Jan 30, 3:08 am, Beres Botond wrote: > You want to use POST, but you are sending your data as GET (without > url encoding). > So I'm pretty sure it cuts before "#", because # is a non-alphanumeric > character and you haven't urlencoded your data. > > Data in URL = GET, not POST, even if you are using $.post . > > http://docs.jquery.com/Post > > So either urlencode your data before putting it in the request or send > it as POST. > > Also I'm not sure how it worked for you on server-side, if you were > expecting $_POST... I assume you were expecting > $_REQUEST instead, which is not a good idea in my opinion. > > On Jan 30, 8:08 am, Mark Livingstone wrote: > > > > > I have the following code: > > > $.post(order_send_email.php?order_message='+order_message) > > > my 'order_message' is: > > > 'Dear '+data['salutation']+" "+data['first_name']+" "+data['last_name'] > > +', \n\nThis is to inform you that your order #'+key+" and payment in > > the amount of...'; > > > When using $.POST... the message gets cut before "#". Is there a limit > > on how much cam be transmitted or am I doing something wrong? > > > Thanks.- Hide quoted text - > > - Show quoted text -
[jQuery] Using $_POST to transmit large key/pair
I have the following code: $.post(order_send_email.php?order_message='+order_message) my 'order_message' is: 'Dear '+data['salutation']+" "+data['first_name']+" "+data['last_name'] +', \n\nThis is to inform you that your order #'+key+" and payment in the amount of...'; When using $.POST... the message gets cut before "#". Is there a limit on how much cam be transmitted or am I doing something wrong? Thanks.
[jQuery] Re: New link being ignored by jQuery
Hi Rick, Thanks for your response. I've got it working now. I used the LiveQuery plugin that you recommended. It took a few attempts but I've finally managed to get it working! Thanks again. Saved me a *lot* of time! Mark On Jan 19, 9:44 pm, "Rick Faircloth" wrote: > Hi, Mark... > > Check into the LiveQuery plug-in and use it on your .click element. > (see the instructions at the plug-in site). You can also use .live function > built into jQuery 1.3, if you're using that. But I understand the .live > function > has some limitations that the LiveQuery doesn't have. > > hth, > > Rick > > > -Original Message- > > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On > > Behalf Of Mark MacInnes > > Sent: Monday, January 19, 2009 1:14 PM > > To: jQuery (English) > > Subject: [jQuery] New link being ignored by jQuery > > > I'm using jQuery to perform some ajax when a link with a certain id is > > clicked on. The ajax updates a database record and then it replaces > > the 'a' tag with a new one. This all works fine. The new 'a' tag has > > the same id as the old one, but text and some other properties on it > > change. It's the id that activates the jQuery functionality. > > > When the old 'a' tag is replaced with the new one the jQuery that > > should operate doesn't work. I understand that this is because the new > > 'a' tag has been added after the page loaded so jQuery doesn't know to > > fire when it's clicked on. Is there anything I can do that will force > > jQuery to fire when the new 'a' tag is clicked? > > > I suspect this has probably been answered a million times, but I don't > > just can't find the right search terms.
[jQuery] New link being ignored by jQuery
I'm using jQuery to perform some ajax when a link with a certain id is clicked on. The ajax updates a database record and then it replaces the 'a' tag with a new one. This all works fine. The new 'a' tag has the same id as the old one, but text and some other properties on it change. It's the id that activates the jQuery functionality. When the old 'a' tag is replaced with the new one the jQuery that should operate doesn't work. I understand that this is because the new 'a' tag has been added after the page loaded so jQuery doesn't know to fire when it's clicked on. Is there anything I can do that will force jQuery to fire when the new 'a' tag is clicked? I suspect this has probably been answered a million times, but I don't just can't find the right search terms.
[jQuery] Re: Alternative stylesheet for jQuery.com
Ah, fantastic, works much better than Greasemonkey, thanks for the link. The only trouble with FF Add-ons is there are so many of them! On Jan 15, 11:52 am, Liam Potter wrote: > you should give stylish a try to do client side CSS changes rather then > greasemonkey.https://addons.mozilla.org/en-US/firefox/addon/2108 > > Mark Gibson wrote: > > Any chance of getting an alternative stylesheet added to jquery.com? > > I've got a small 1024x600 display, and the heading of jquery.com, nice > > as it is, takes up a lot of space. I'd just like to suggest adding the > > following as an alternative (using ) for folk with vertically impaired screens: > > > At the minute I use greasemonkey to add this, but I thought others may > > benefit too. > > > Regards > > - Mark Gibson
[jQuery] Alternative stylesheet for jQuery.com
Any chance of getting an alternative stylesheet added to jquery.com? I've got a small 1024x600 display, and the heading of jquery.com, nice as it is, takes up a lot of space. I'd just like to suggest adding the following as an alternative (using ) for folk with vertically impaired screens: #jq-secondaryNavigation { margin-top: 4px; } #jq-secondaryNavigation ul, #jq-footerNavigation ul { width: auto; } #jq-siteLogo { top: 14px; } #jq-header { height: 80px; } body#jq-interior #jq-header { height:102px; } #jq-content { padding-top: 1em; } #jq-header h1, #jq-primarySearchForm { bottom: 4px; } At the minute I use greasemonkey to add this, but I thought others may benefit too. Regards - Mark Gibson
[jQuery] stock price ticker plugin?
hi guys, i am looking for a stock price ticker plugin, that will change color of the price green or red, and also change in real time. do you guys know any plugins or any other suggestions for this? thanks
[jQuery] Re: Show/Hide Toggle Table
You were spot on. Thanks for your help! On Jan 11, 8:17 am, "cherry.aus...@gmail.com" wrote: > Hi. I confess I didn't read your code very thoroughly, but it looks > like it might be as simple as repeated IDs. You can only have one > instance of each ID per page. Try changing it to a class (or adding an > iterator to each ID). > > Sorry if this isn't the right answer? > Cherry. > > On Jan 10, 1:06 pm, mark wrote: > > > Hey Guys, I'm new to jquery, and haven't much experience with > > javascript. I'm trying to toggle a few rows on a table with a show/ > > hide. Is this possible with a table or do I need to rewrite my view > > using divs? > > > > > $(document).ready(function() { > > // hides the slickbox as soon as the DOM is ready > > // (a little sooner than page load) > > $('#slickbox').hide(); > > > // toggles the slickbox on clicking the noted link > > $('a#slick-toggle').click(function() { > > $('#slickbox').toggle(250); > > return false; > > }); > > > }); > > > > > > > > > > Description > > Business value > > Story points > > > > > <% for story in @stories %> > > "> > > > > [+] > > <%=h story.description %> > > > > <%=h story.business_value %> > > <%=h story.story_points %> > > <%= link_to 'Show', story %> > > <%= link_to 'Edit', edit_story_path > > (story) %> > > <%= link_to 'Destroy', story, :confirm > > => 'Are you sure?', :method => :delete %> > > > > > > <% if story.tasks.count > 0 %> > > > > Task > > Assigned User > > Rem. Time > > > > <% for task in story.tasks %> > > "> > > <%=h task.task %> > > <%=h task.user_id %> > > <%=h humanize_time( > > Task.calculate_remaining_time_on_task > > ( task.id ) ) %> > > > > <% end %> > > > > > > Remaining: > > <%= humanize_time( > > Task.calculate_remaining_time_on_story > > ( story.id ) ) %> > > > > <% end %> > > > > <% end %> > > > > > > > > <%= link_to 'New story', new_story_path %>
[jQuery] Show/Hide Toggle Table
Hey Guys, I'm new to jquery, and haven't much experience with javascript. I'm trying to toggle a few rows on a table with a show/ hide. Is this possible with a table or do I need to rewrite my view using divs? $(document).ready(function() { // hides the slickbox as soon as the DOM is ready // (a little sooner than page load) $('#slickbox').hide(); // toggles the slickbox on clicking the noted link $('a#slick-toggle').click(function() { $('#slickbox').toggle(250); return false; }); }); Description Business value Story points <% for story in @stories %> "> [+] <%=h story.description %> <%=h story.business_value %> <%=h story.story_points %> <%= link_to 'Show', story %> <%= link_to 'Edit', edit_story_path (story) %> <%= link_to 'Destroy', story, :confirm => 'Are you sure?', :method => :delete %> <% if story.tasks.count > 0 %> Task Assigned User Rem. Time <% for task in story.tasks %> "> <%=h task.task %> <%=h task.user_id %> <%=h humanize_time( Task.calculate_remaining_time_on_task ( task.id ) ) %> <% end %> Remaining: <%= humanize_time( Task.calculate_remaining_time_on_story ( story.id ) ) %> <% end %> <% end %> <%= link_to 'New story', new_story_path %>