[jQuery] Classis ASP integrating Async Treeview Plugin using getJSON. Stops working when using response.write [variable name] instead of simple JSON string
Hi all, I've loved using jQuery these past few months, but I'm really pulling my hair our here. The following is the endpoint asp code that gets called to populate my treeview: % rootid = request.querystring(rootid) json = set Conn = server.CreateObject(ADODB.Connection) Conn.Open strProvider if rootid = source then json = [ set RS = Server.CreateObject(ADODB.RecordSet) Sql = select categoryid,categoryname,(select count(*) from tblcategories where parentid = c1.categoryid) ChildCount from tblcategories c1 where parentid = 0 session(errorsql) = sql set Cmd = Server.CreateObject(ADODB.Command) Cmd.CommandText = Sql Cmd.ActiveConnection = Conn rs.open Cmd if not RS.EOF then GotRows = y arrResultSet = RS.GetRows() numRows = ubound(arrResultSet,2) For i = 0 to numRows categoryid = arrResultSet(0,i) categoryname = arrResultSet(1,i) childcount = cint(arrResultSet(2,i)) json = json {'text': ' categoryname ','id':' categoryid ' if childcount 0 then json = json , 'hasChildren':true end if json = json } if i numRows then json = json , end if Next else GotRows = n json = json {'text': 'No Categories have been created'} end if json = json ] RS.close elseif isnumeric(rootid) and rootid then json = [ set RS = Server.CreateObject(ADODB.RecordSet) Sql = select categoryid,categoryname,(select count(*) from tblcategories where parentid = c1.categoryid) ChildCount from tblcategories c1 where parentid = ? session(errorsql) = sql set Cmd = Server.CreateObject(ADODB.Command) Cmd.Parameters.Append CreateIntParameter(Cmd, rootid, rootid) Cmd.CommandText = Sql Cmd.ActiveConnection = Conn rs.open Cmd if not RS.EOF then GotRows = y arrResultSet = RS.GetRows() numRows = ubound(arrResultSet,2) For i = 0 to numRows categoryid = arrResultSet(0,i) categoryname = arrResultSet(1,i) childcount = cint(arrResultSet(2,i)) json = json {'text': ' categoryname ','id':' categoryid ' if childcount 0 then json = json , 'hasChildren':true end if json = json } if i numRows then json = json , end if Next else GotRows = n end if json = json ] RS.close end if set Cmd = nothing set RS=nothing conn.close set conn=nothing response.write json % This code produces the following JSON string viewable when I hit the page directly with the ?rootid=source parameter: [{'text': 'Cat1.0','id':'1'},{'text': 'Cat1.1','id':'2', 'hasChildren':true},{'text': 'Cat1.2','id':'3'}] Unless I've received a severe blow to the head, I recognize this as valid JSON and just what the treeview needs to produce a flat display of 3 nodes with the second having a '+' sign for expandability. Here's the frustrating part, when I past that string into the body of my asp page, comment out the response.write line, save, and run everything I get the simple tree that I'd expect. When I remove the JSON string, and uncomment the response.write line, nothing happens. I've tried flushing the response object, ending the response object, clearing the response before writing to it, yet nothing seems to work. Please, please help!
[jQuery] JQuery list moving from Google to Zoho?
Hi all, Can someone confirm that this list is moving from Google to Zoho Discussions? With the recent spate of cyber attacks I try to confirm emails like the one I got over the weekend to register at Zoho. Thanks, Doug
[jQuery] Re: post AJAX no response
Hi David, Do you have your call inside a $(document).ready? It may be that in a high bandwidth environment your data loads completely before your call is triggered, whereas in a low bandwidth environment your page has the chance to finish loading before the data makes it to your call. My two cents, Doug -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of David Sent: Thursday, October 08, 2009 2:40 PM To: jQuery (English) Subject: [jQuery] post AJAX no response Hi, I have a problem with an AJAX call. It's a long time since a got it. I don't know how to deal with it. I have made tests and I don't know why it's happening. I have a post AJAX call. Just like next one: $.post(MY_SCRIPT, { db_id: selected_data}, function(data){ ... }); The problem is, some times it returns data, and some times it doesn't. I have test it with FF and Chrome, it doesn't mater the browser. It has nothing to do with domain server crossing, nor server errors, as it some times works and some times it doesn't. What I have found is, it works most of the times in a high bandwith connection (enterprise bandwith). Buit when I try it at home, most of the times it does not work. The function does not receive any data from the server. I have checked the server when it happens, and the server returns data. It is as if the data got lost in the response. I don't know what to do, as I don't know where the problem is. Thanks
[jQuery] Re: AJAX: Display raw XML Document
Just my two cents, I have to agree, it would be nice to be able to at a minimum dump the actual XML from the Ajax call. -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Jonathan Sent: Wednesday, September 16, 2009 1:33 PM To: jQuery (English) Subject: [jQuery] Re: AJAX: Display raw XML Document I still can't find a solution to simply print out the XML response from an AJAX call. I'm surprised jQuery can't handle something that simple, as it can otherwise do so much. The other js libraries don't seem to have a problem with it, it looks like jQuery just isn't up to the task, and I can't use it for this project. Disappointed. On Sep 14, 11:53 pm, Jonathan jonandke...@gmail.com wrote: I'm re-writing a test page for a RESTful web service with AJAX, and need to be able to display the XML or JSON response in a textarea or a div. I'm re-writing the web page to work off jQuery, but I'm stuck here. The best response I can get is: [Object XMLDocument] I have to set a custom Authorization header, set an HTTP method (get, put, post, or delete), send data, and display the raw XML (or JSON, depending on the request) response in the page. With firebug I see the XML response is there, but I can't figure out how to display that raw XML with jQuery. It worked with the prototype js, but I'm stumped trying to get it to work with jQuery. It seems like a simple enough task, the XML is there, I want to print it out on the page. I've spent hours searching through the jQuery docs and online examples to no avail. Any ideas?
FW: [jQuery] Re: Newbie: Cannot get .text() to work with IE7
Sure could use some help on this one. Does anyone on the list have any clue why the .text() function works differently between FF and IE7? I've submitted this question for over a week now, and had no suggestions at all. Doug From: Knight, Doug Sent: Tuesday, September 08, 2009 9:40 AM To: jquery-en@googlegroups.com Subject: RE: [jQuery] Re: Newbie: Cannot get .text() to work with IE7 Hi all, I've posted this issue a few times now, and received no response aside from a comment on a typo I had already caught. Is there anything else I need to provide so that someone might take an interest in this issue? I would post a web site where I have the scripts, but where I work I don't have access to an external public web site. Thanks in advance for anyone who can help. I have also included the web browser output from FF 3.5.2, and IE7 at the bottom of the email. Doug (snip) All, I'm new to jQuery, but not JavaScript. I have the following really simple html file with jQuery-based JavaScript to open, read and display part of an xml file. It works fine on FF 3.5.2, but does not work on IE7. Am I missing something really simple to make jQuery work on IE7? Any help would be great, thanks! Doug Knight Here's the html/JavaScript: html head titleRead XML/title script src=lib/jquery.js type=text/javascript charset=utf-8/script script type=text/javascript charset=utf-8 jQuery(function(){ //$(document).ready(function(){ jQuery.get(test.xml,{},function(xml){ //$.get(test.xml,{},function(xml){ DBArea = ''; // This displays the values from the XML file DBArea += xml = : + xml + :\n; // I get blanks here DBArea += $(xml).text() = : + $(xml).text() + :\n; // The following gives [Object Object] ph_sites = $(xml).find('product_header_sites'); DBArea += ph_sites = : + ph_sites + :\n; // And the following gives blanks too ph_sites = $(xml).find('product_header_sites').text(); DBArea += ph_sites = : + ph_sites + :\n; // Update the DIV called Content Area with the HTML string $(#DebugArea).append(pre + DBArea + /pre); }); }); /script /head body div id=DebugArea/div /body /html And here's the XML file: text_msg product_header product_header_site_id255/product_header_site_id product_header_node191/product_header_node product_header_byte_count332/product_header_byte_count product_header_product_type2/product_header_product_type product_header_product_status0/product_header_product_status product_header_sitesF90/product_header_sites /product_header /text_msg FF3.5.2 output: xml = : 255 191 332 2 0 F90 : $(xml).text() = : 255 191 332 2 0 F90 : ph_sites = :[object Object]: ph_sites = :F90: IE Output: xml = : 255 191 332 2 0 F90 : $(xml).text() = :: ph_sites = :[object Object]: ph_sites = ::
RE: FW: [jQuery] Re: Newbie: Cannot get .text() to work with IE7
Thank you very much, Brett, worked like a charm! Guess I was googling on the wrong issue. For all, here is the revised script: html head titleRead XML/title script src=lib/jquery.js type=text/javascript/script script type=text/javascript $(document).ready(function(){ // Changes start here $.ajax({ type: GET, url: file:unk.xml, dataType: ($.browser.msie) ? text : xml, success: function(data) { var xml; if (typeof data == string) { xml = new ActiveXObject(Microsoft.XMLDOM); xml.async = false; xml.loadXML(data); } else { xml = data; } // Changes end here, plus one extra closing brace below var DBArea = ''; // This displays the values from the XML file DBArea += xml = : + xml + :\n; // I get blanks here DBArea += $(xml).text() = : + $(xml).text() + :\n; // The following gives [Object Object] var ph_sites = $(xml).find('product_header_sites'); DBArea += $(xml).find('product_header_sites') = : + ph_sites + :\n; // And the following gives blanks too ph_sites = $(xml).find('product_header_sites').text(); DBArea += $(xml).find('product_header_sites').text() = : + ph_sites + :\n; // Update the DIV called Content Area with the HTML string $(#DebugArea).append(pre + DBArea + /pre); } // end success function }); // end ajax function }); // end jQuery function /script /head body div id=DebugArea/div /body /html Thanks again, Doug -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Brett Ritter Sent: Thursday, September 10, 2009 9:18 AM To: jquery-en@googlegroups.com Subject: Re: FW: [jQuery] Re: Newbie: Cannot get .text() to work with IE7 On Thu, Sep 10, 2009 at 8:21 AM, Knight, Doug dkni...@mitre.org wrote: Sure could use some help on this one. Does anyone on the list have any clue why the .text() function works differently between FF and IE7? I've Okay, so here's the basics: It isn't .text(), that's just showing the problem. The problem is your $(xml) call. As I understand it, Jquery relies on the underlying DOM parser of the browser. Non-IE browsers handle XML casually, IE browsers are more specific. (as easy as it is to rip on MS/IE, I'm not convinced the IE behavior is wrong, per se, but it's clear that being right doesn't make things easier). Google for JQuery IE XML Parsing returns a fair number of hits on this if you want to delve in deeper. Sadly it looks like the answer is a little complicated. http://docs.jquery.com/Specifying_the_Data_Type_for_AJAX_Requests The above link covers your exact case and shows a work around for loading local files - it may behave differently on a server. I've not played with it myself as of yet. Sorry you didn't get a faster response. -- Brett Ritter / SwiftOne swift...@swiftone.org
[jQuery] Re: Newbie: Cannot get .text() to work with IE7
Hi all, I've posted this issue a few times now, and received no response aside from a comment on a typo I had already caught. Is there anything else I need to provide so that someone might take an interest in this issue? I would post a web site where I have the scripts, but where I work I don't have access to an external public web site. Thanks in advance for anyone who can help. I have also included the web browser output from FF 3.5.2, and IE7 at the bottom of the email. Doug (snip) All, I'm new to jQuery, but not JavaScript. I have the following really simple html file with jQuery-based JavaScript to open, read and display part of an xml file. It works fine on FF 3.5.2, but does not work on IE7. Am I missing something really simple to make jQuery work on IE7? Any help would be great, thanks! Doug Knight Here's the html/JavaScript: html head titleRead XML/title script src=lib/jquery.js type=text/javascript charset=utf-8/script script type=text/javascript charset=utf-8 jQuery(function(){ //$(document).ready(function(){ jQuery.get(test.xml,{},function(xml){ //$.get(test.xml,{},function(xml){ DBArea = ''; // This displays the values from the XML file DBArea += xml = : + xml + :\n; // I get blanks here DBArea += $(xml).text() = : + $(xml).text() + :\n; // The following gives [Object Object] ph_sites = $(xml).find('product_header_sites'); DBArea += ph_sites = : + ph_sites + :\n; // And the following gives blanks too ph_sites = $(xml).find('product_header_sites').text(); DBArea += ph_sites = : + ph_sites + :\n; // Update the DIV called Content Area with the HTML string $(#DebugArea).append(pre + DBArea + /pre); }); }); /script /head body div id=DebugArea/div /body /html And here's the XML file: text_msg product_header product_header_site_id255/product_header_site_id product_header_node191/product_header_node product_header_byte_count332/product_header_byte_count product_header_product_type2/product_header_product_type product_header_product_status0/product_header_product_status product_header_sitesF90/product_header_sites /product_header /text_msg FF3.5.2 output: xml = : 255 191 332 2 0 F90 : $(xml).text() = : 255 191 332 2 0 F90 : ph_sites = :[object Object]: ph_sites = :F90: IE Output: xml = : 255 191 332 2 0 F90 : $(xml).text() = :: ph_sites = :[object Object]: ph_sites = ::
[jQuery] Re: Newbie: Cannot get .text() to work with IE7
Hi Leonardo, I caught that right after I posted. With it fixed, I still have the same issues between FF and IE7. Doug From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Leonardo K Sent: Wednesday, September 02, 2009 8:41 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Newbie: Cannot get .text() to work with IE7 Maybe its a problem with you xml: product_header_sitesF90/product_header_itws_sites On Wed, Sep 2, 2009 at 08:53, Knight, Doug dkni...@mitre.orgmailto:dkni...@mitre.org wrote: All, I wasn't sure if this got lost in the shuffle of my first post. Does anyone know why the following works under FF and not under IE7? There are comments within the code to explain what I'm seeing. Sorry, I don't have an external facing website on which to post this. Doug From: jquery-en@googlegroups.commailto:jquery-en@googlegroups.com [mailto:jquery-en@googlegroups.commailto:jquery-en@googlegroups.com] On Behalf Of Knight, Doug Sent: Monday, August 31, 2009 2:35 PM To: jquery-en@googlegroups.commailto:jquery-en@googlegroups.com Subject: [jQuery] Newbie: Cannot get .text() to work with IE7 All, I'm new to jQuery, but not JavaScript. I have the following really simple html file with jQuery-based JavaScript to open, read and display part of an xml file. It works fine on FF 3.5.2, but does not work on IE7. Am I missing something really simple to make jQuery work on IE7? Any help would be great, thanks! Doug Knight Here's the html/JavaScript: html head titleRead XML/title script src=lib/jquery.js type=text/javascript charset=utf-8/script script type=text/javascript charset=utf-8 jQuery(function(){ //$(document).ready(function(){ jQuery.get(test.xml,{},function(xml){ //$.get(test.xml,{},function(xml){ DBArea = ''; // This displays the values from the XML file DBArea += xml = : + xml + :\n; // I get blanks here DBArea += $(xml).text() = : + $(xml).text() + :\n; // The following gives [Object Object] ph_sites = $(xml).find('product_header_sites'); DBArea += ph_sites = : + ph_sites + :\n; // And the following gives blanks too ph_sites = $(xml).find('product_header_sites').text(); DBArea += ph_sites = : + ph_sites + :\n; // Update the DIV called Content Area with the HTML string $(#DebugArea).append(pre + DBArea + /pre); }); }); /script /head body div id=DebugArea/div /body /html And here's the XML file: text_msg product_header product_header_site_id255/product_header_site_id product_header_node191/product_header_node product_header_byte_count332/product_header_byte_count product_header_product_type2/product_header_product_type product_header_product_status0/product_header_product_status product_header_sitesF90/product_header_sites /product_header /text_msg
[jQuery] RE: Newbie: Cannot get .text() to work with IE7
All, I wasn't sure if this got lost in the shuffle of my first post. Does anyone know why the following works under FF and not under IE7? There are comments within the code to explain what I'm seeing. Sorry, I don't have an external facing website on which to post this. Doug From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Knight, Doug Sent: Monday, August 31, 2009 2:35 PM To: jquery-en@googlegroups.com Subject: [jQuery] Newbie: Cannot get .text() to work with IE7 All, I'm new to jQuery, but not JavaScript. I have the following really simple html file with jQuery-based JavaScript to open, read and display part of an xml file. It works fine on FF 3.5.2, but does not work on IE7. Am I missing something really simple to make jQuery work on IE7? Any help would be great, thanks! Doug Knight Here's the html/JavaScript: html head titleRead XML/title script src=lib/jquery.js type=text/javascript charset=utf-8/script script type=text/javascript charset=utf-8 jQuery(function(){ //$(document).ready(function(){ jQuery.get(test.xml,{},function(xml){ //$.get(test.xml,{},function(xml){ DBArea = ''; // This displays the values from the XML file DBArea += xml = : + xml + :\n; // I get blanks here DBArea += $(xml).text() = : + $(xml).text() + :\n; // The following gives [Object Object] ph_sites = $(xml).find('product_header_sites'); DBArea += ph_sites = : + ph_sites + :\n; // And the following gives blanks too ph_sites = $(xml).find('product_header_sites').text(); DBArea += ph_sites = : + ph_sites + :\n; // Update the DIV called Content Area with the HTML string $(#DebugArea).append(pre + DBArea + /pre); }); }); /script /head body div id=DebugArea/div /body /html And here's the XML file: text_msg product_header product_header_site_id255/product_header_site_id product_header_node191/product_header_node product_header_byte_count332/product_header_byte_count product_header_product_type2/product_header_product_type product_header_product_status0/product_header_product_status product_header_sitesF90/product_header_sites /product_header /text_msg
[jQuery] Newbie: Cannot get .text() to work with IE7
All, I'm new to jQuery, but not JavaScript. I have the following really simple html file with jQuery-based JavaScript to open, read and display part of an xml file. It works fine on FF 3.5.2, but does not work on IE7. Am I missing something really simple to make jQuery work on IE7? Any help would be great, thanks! Doug Knight Here's the html/JavaScript: html head titleRead XML/title script src=lib/jquery.js type=text/javascript charset=utf-8/script script type=text/javascript charset=utf-8 jQuery(function(){ //$(document).ready(function(){ jQuery.get(test.xml,{},function(xml){ //$.get(test.xml,{},function(xml){ DBArea = ''; // This displays the values from the XML file DBArea += xml = : + xml + :\n; // I get blanks here DBArea += $(xml).text() = : + $(xml).text() + :\n; // The following gives [Object Object] ph_sites = $(xml).find('product_header_sites'); DBArea += ph_sites = : + ph_sites + :\n; // And the following gives blanks too ph_sites = $(xml).find('product_header_sites').text(); DBArea += ph_sites = : + ph_sites + :\n; // Update the DIV called Content Area with the HTML string $(#DebugArea).append(pre + DBArea + /pre); }); }); /script /head body div id=DebugArea/div /body /html And here's the XML file: text_msg product_header product_header_site_id255/product_header_site_id product_header_node191/product_header_node product_header_byte_count332/product_header_byte_count product_header_product_type2/product_header_product_type product_header_product_status0/product_header_product_status product_header_sitesF90/product_header_itws_sites /product_header /text_msg
[jQuery] Ingrid, the jQuery datagrid!
Hi all, Happy to announce that the Ingrid datagrid project is still very much alive! With the help of Patrice Blanchardie, Ingrid has been moved to its new home on Google Code, and includes quite a few bug fixes and updates (full list below). Also included is an updated example of a remote PHP script used to render the table-html input required by Ingrid. It clearly illustrates what params are passed in from Ingrid (page, sort, sort dir, etc). I know this is easily retrieved via Firebug's concole tab - but I get plenty of emails on this anyway, so happy this is now available! The community has been as active as ever, and I continue to get emails from user suggesting new features, asking for help, or just saying hello. A *big* thank you to everyone who has helped, and those who continue to help, making Ingrid a better plugin. Cheers, Matt http://www.reconstrukt.com/ingrid/ http://code.google.com/p/jq-ingrid/ v.9.4 (Thanks Patrice!) - bug fix: unable to clear last selected row from cookie - bug fix: added onRowSelect callback during pre-selection - feature: new param: unsortable columns - feature: selection is now stored for all pages - feature: page changed callback v.9.3 (Thanks Patrice!) - Moved to Google Code - bug fix: selection behaviour - bug fix: hscroll width - bug fix: attribute selector - bug fix: result error handler - bug fix: header auto-resize - feature: new methods: unselect all, select all
[jQuery] Re: ui draggable (option drag doesn't work)
Richard you are right. I've missed this thing placing new version of jQuery. Thanks.
[jQuery] ui draggable (option drag doesn't work)
Hello, The question is why drag-option doesn't work ( options.drag = function (event,info) { alert('drag'); } )? Thanks in advance. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titleScroll element/title style type=text/css .scrollable { overflow:hidden; height:200px; width:350px; margin:100px auto; } .bloc { margin:5px auto; font-size:12px; } .scr_cnt_handle { float:left; height:100%; border:1px solid #000; } .scr_body { float:left; overflow:hidden; height:200px; width:300px; } .ctr_handle { width:20px; height:40px; background-color:#006699; } /style script src=jquery-1.3.1.min.js type=text/javascript language=javascript/script script src=ui.core.js type=text/javascript language=javascript/script script src=ui.draggable.js type=text/javascript language=javascript/script script type=text/javascript language=javascript $(function(){ var options = {}; options.containment = 'parent'; options.axis = 'y'; options.drag = function(event,info) { alert('drag'); } $('.ctr_handle').draggable(options); }); /script /head body div class=scrollable div class=scr_body div class=bloc img src=FooterRevision.png width=60 height=60 style=float:left; / Text some here text! Text some here text! Text some here text! Text some here text! /div div class=bloc img src=InteriorPage1.png width=60 height=60 style=float:left; / Text some here text! Text some here text! Text some here text! Text some here text! /div div class=bloc img src=InteriorPage2.png width=60 height=60 style=float:left; / Text some here text! Text some here text! Text some here text! Text some here text! /div div class=bloc img src=FooterRevision.png width=60 height=60 style=float:left; / Text some here text! Text some here text! Text some here text! Text some here text! /div /div div class=scr_cnt_handle div class=ctr_handle/div /div div style=clear:both;/div /div /body /html
[jQuery] jQuery .post and.load with some PHP
Okay, so I have This PHP code. It creates a list of all the categories from database and it creates a div with all the items from the database. Each item is associated with a category id as to which category it is apart of. The list of categories should be clicked on and then the jQuery will run a post of the category id and then reload the list of items to only show items in the selected category. if(!empty($_POST) || $catSortID != ) { $catSortID = $_POST['catSortID']; $catSortItem = WHERE category_id = . $catSortID; } else { $catSortItem = ; } $catList = mysql_query(SELECT * FROM adminCategory ORDER BY CategoryName); $catLinks = array(); while ($catlistRow = mysql_fetch_array($catList)) { $catLinks[] = 'a href=javascript:; class=sortCat id=sortCat_'. $catlistRow['id'].' onclick=sortItemCat('.$catlistRow['id'].')'. $catlistRow['CategoryName'] .'/a'; } echo p id=\catSortList\ . implode(' | ', $catLinks) . /p\n \n; $result = mysql_query('SELECT * FROM adminItems'.$catSortItem.' ORDER BY id'); while ($row = mysql_fetch_array($result)) { $textmsg = $line = str_replace(|, /lili, $row['textmsg']); $catID = $row['category_id']; $catsql = SELECT * FROM adminCategory WHERE id = . $catID; $catName = mysql_query($catsql); while ($catRow = mysql_fetch_array($catName)) { print 'div id=Item_' . $row['id'] . ' class=itemListBox img src=../content/img/items/imgresize.php?src=../content/'.$row ['image_url'].'w=100 alt='.$row['name'].' title='.$row['name'].' class=itemListImg / divh3 class=itemTitle' . $catRow['CategoryName'] . ' raquo; '.$row['name'].'/h3 p class=itemDescstrongDescription: /strong'.$row ['description'].'/p p class=itemMsgstrongText Message(s): /strong/p ol class=itemMsgListli'.$textmsg./li/ol/div /div\n\n; } } Problem is, whenever jQuery runs a post and then loads it, it never returns with only the selected category items. function sortItemCat(id) { var catList = $(#sortCat_+id).text(); $.post('lib/loadItem.php', { catSortID: id }, function(data) { if(dataq){ $(#itemList).load(lib/loadItem.php); }else{alert(data+ -- +id+ -- +catList);} }); } Any idea as to what might be going on?
[jQuery] Re: jQuery .post and.load with some PHP
The jQuery code should be as follows function sortItemCat(id) { var catList = $(#sortCat_+id).text(); $.post('lib/loadItem.php', { catSortID: id }, function(data) { if(data != 'false'){ $(#itemList).load(lib/loadItem.php); }else{alert(data+ -- +id+ -- +catList);} }); } On Jan 26, 9:24 pm, Good Knight kyleakni...@gmail.com wrote: Okay, so I have This PHP code. It creates a list of all the categories from database and it creates a div with all the items from the database. Each item is associated with a category id as to which category it is apart of. The list of categories should be clicked on and then the jQuery will run a post of the category id and then reload the list of items to only show items in the selected category. if(!empty($_POST) || $catSortID != ) { $catSortID = $_POST['catSortID']; $catSortItem = WHERE category_id = . $catSortID;} else { $catSortItem = ; } $catList = mysql_query(SELECT * FROM adminCategory ORDER BY CategoryName); $catLinks = array(); while ($catlistRow = mysql_fetch_array($catList)) { $catLinks[] = 'a href=javascript:; class=sortCat id=sortCat_'. $catlistRow['id'].' onclick=sortItemCat('.$catlistRow['id'].')'. $catlistRow['CategoryName'] .'/a'; } echo p id=\catSortList\ . implode(' | ', $catLinks) . /p\n \n; $result = mysql_query('SELECT * FROM adminItems'.$catSortItem.' ORDER BY id'); while ($row = mysql_fetch_array($result)) { $textmsg = $line = str_replace(|, /lili, $row['textmsg']); $catID = $row['category_id']; $catsql = SELECT * FROM adminCategory WHERE id = . $catID; $catName = mysql_query($catsql); while ($catRow = mysql_fetch_array($catName)) { print 'div id=Item_' . $row['id'] . ' class=itemListBox img src=../content/img/items/imgresize.php?src=../content/'.$row ['image_url'].'w=100 alt='.$row['name'].' title='.$row['name'].' class=itemListImg / divh3 class=itemTitle' . $catRow['CategoryName'] . ' raquo; '.$row['name'].'/h3 p class=itemDescstrongDescription: /strong'.$row ['description'].'/p p class=itemMsgstrongText Message(s): /strong/p ol class=itemMsgListli'.$textmsg./li/ol/div /div\n\n; } } Problem is, whenever jQuery runs a post and then loads it, it never returns with only the selected category items. function sortItemCat(id) { var catList = $(#sortCat_+id).text(); $.post('lib/loadItem.php', { catSortID: id }, function(data) { if(dataq){ $(#itemList).load(lib/loadItem.php); }else{alert(data+ -- +id+ -- +catList);} }); } Any idea as to what might be going on?
[jQuery] Reload Part of a Page
Is there an easy way to reload a section of a page? I have a .post() that updates the contents of an unordered list, but i have to refresh the page to see the new contents of the UL. Anyway to have the UL reload when the .post() goes off? I am using the Impromptu plugin to run the post, but this should be just a basic jQuery issue I don't think it's a plugin question. Code can be found at http://www.pastie.org/368851 Any ideas would be very useful!
[jQuery] Re: Reload Part of a Page
Hi. I don't think that will work. The category list that creates the UL is a PHP which statement http://www.pastie.org/369269 It would have to rerun that PHP script everytime the .post() is ran from the initial javascript. On Jan 23, 4:30 pm, jay jay.ab...@gmail.com wrote: just reload it with whatever is in the data variable. $(#myUL).html (data) will do the trick assuming your data is just html like li1/ lili2/li On Jan 23, 12:46 pm, Good Knight kyleakni...@gmail.com wrote: Is there an easy way to reload a section of a page? I have a .post() that updates the contents of an unordered list, but i have to refresh the page to see the new contents of the UL. Anyway to have the UL reload when the .post() goes off? I am using the Impromptu plugin to run the post, but this should be just a basic jQuery issue I don't think it's a plugin question. Code can be found athttp://www.pastie.org/368851 Any ideas would be very useful!
[jQuery] Re: Reload Part of a Page
Ahh, I see what you're saying. I got it working! Thanks! On Jan 23, 6:37 pm, Mike Alsup mal...@gmail.com wrote: Hi. I don't think that will work. The category list that creates the UL is a PHP which statementhttp://www.pastie.org/369269 It would have to rerun that PHP script everytime the .post() is ran from the initial javascript. I think Jay is making the reasonable assumption that the response from addCategory.php is the markup for the new list items. If so, then you what he suggested: $('#myList').html(data); If the response is something else, or nothing at all, then you need to fetch it with a GET. How you implement it on the server is up to you, but the jQuery code could be as simple as this: $('#myList').load('lib/getCategory.php?category=' + catName);
[jQuery] Re: Ingrid, jQuery Datagrid : Update, v0.9.1
Excellent, thanks Karl for that feedback - I'll make a note of it. Anything else, let me know Matt On Nov 11, 11:57 pm, Karl Rudd [EMAIL PROTECTED] wrote: A quick initial test on Safari 2.0.4 comes up with a syntax error on line 124 of the main JS file, jquery. .css({float: 'left', display: 'block'}) My guess is that it doesn't like float being there (probably one of those keywords that were never used in JavaScript but were still reserved). Put quotes around it, 'float', and it should work. It's not easy to test the plugin at the moment. It'd be great to have a Zip archive with some basic examples. Karl Rudd On Nov 12, 2007 3:18 PM, Rey Bango [EMAIL PROTECTED] wrote: Guys, I would also like to have folks do cross browser testing on this in order to help Matt truly iron out any issues. People with Safari 2.x installed would be especially helpful. Rey matthew knight wrote: Hi All, I've just posted the latest version of Ingrid datagrid plugin. Incorporates a lot of feedback I've received over the last couple weeks, including: - Row selection - Saving state (page number, column sort amp; direction, selected rows) - Exposed object model, added helper methods like ingrid.getSelectedRows(), ingrid.getColumn(), etc - A couple bug fixes and some general code refactoring. I confess I added way too many comments. I'll get to those later... http://www.reconstrukt.com/ingrid/ Check it out and let me know your thoughts. Please send bugs, I'm an absolutely awful tester. :) Cheers, Matt
[jQuery] Re: Ingrid, jQuery Datagrid : Update, v0.9.1
@Andy: The latency isn't Ingrid itself: its the data coming back - the feed is very slow to respond. When tested with a local data store, response time is (almost) instant. She's quick. Please have another look and confirm this when you get a chance (use a tool like Fiddler, for example, and watch the request/response times.) Cheers, Matt On Nov 12, 7:47 am, matthew knight [EMAIL PROTECTED] wrote: Excellent, thanks Karl for that feedback - I'll make a note of it. Anything else, let me know Matt On Nov 11, 11:57 pm, Karl Rudd [EMAIL PROTECTED] wrote: A quick initial test on Safari 2.0.4 comes up with a syntax error on line 124 of the main JS file, jquery. .css({float: 'left', display: 'block'}) My guess is that it doesn't like float being there (probably one of those keywords that were never used in JavaScript but were still reserved). Put quotes around it, 'float', and it should work. It's not easy to test the plugin at the moment. It'd be great to have a Zip archive with some basic examples. Karl Rudd On Nov 12, 2007 3:18 PM, Rey Bango [EMAIL PROTECTED] wrote: Guys, I would also like to have folks do cross browser testing on this in order to help Matt truly iron out any issues. People with Safari 2.x installed would be especially helpful. Rey matthew knight wrote: Hi All, I've just posted the latest version of Ingrid datagrid plugin. Incorporates a lot of feedback I've received over the last couple weeks, including: - Row selection - Saving state (page number, column sort amp; direction, selected rows) - Exposed object model, added helper methods like ingrid.getSelectedRows(), ingrid.getColumn(), etc - A couple bug fixes and some general code refactoring. I confess I added way too many comments. I'll get to those later... http://www.reconstrukt.com/ingrid/ Check it out and let me know your thoughts. Please send bugs, I'm an absolutely awful tester. :) Cheers, Matt
[jQuery] Ingrid, jQuery Datagrid : Update, v0.9.1
Hi All, I've just posted the latest version of Ingrid datagrid plugin. Incorporates a lot of feedback I've received over the last couple weeks, including: - Row selection - Saving state (page number, column sort amp; direction, selected rows) - Exposed object model, added helper methods like ingrid.getSelectedRows(), ingrid.getColumn(), etc - A couple bug fixes and some general code refactoring. I confess I added way too many comments. I'll get to those later... http://www.reconstrukt.com/ingrid/ Check it out and let me know your thoughts. Please send bugs, I'm an absolutely awful tester. :) Cheers, Matt
[jQuery] Re: jQuery Datagrid Plugin v.7
Thanks Marco, Also cheers for reporting the bug with the page toolbar textbox - this is now fixed. Download the latest here: http://reconstrukt.com/ingrid/index.html#download Matt On Oct 3, 8:00 pm, Web Specialist [EMAIL PROTECTED] wrote: Matt, congratulations!!! Very very very nice grid plugin. Your ajax for server side content and pagination is really awesome. Cheers Marco Antonio 2007/10/3, reconstrukt [EMAIL PROTECTED]: Hey all, I just released Just finished the initial release of my datagrid plugin. I named her Ingrid. :) Features in this release: - resizable columns - paging toolbar - sorting (server-side) - row column styling The goal here is to give jQuery a robust, native datagrid that's up to snuff with those found in the EXT or YUI libraries. Check it out here:http://www.reconstrukt.com/ingrid/ Thanks much Matt
[jQuery] Re: jQuery Datagrid Plugin v.7
@Sharique Yes, it'll work with .NET (just create an aspx page that spits out a table as per the instrux), and set the 'url' param accordingly in the options. Remember, ingrid's just making an ajax call to some more HTML. Something like this will work: $(document).ready( function() { $(#table1).ingrid({ url: 'myPage.aspx', height: 350 }); } ); --- @Saidur Think you found a little easter egg - that 'remote.html' shouldn't be in the actual plugin, it should be set as part of the setup Regardless, I should include a sample remote.html file in the download. I'll send around an update when these changes are in. Cheers! --- @Guy Yes, you can use ingrid to style inline tables if you want. In the options, you'll want to set paging:false, sorting:false --- @Shawn Yep, good call, i'm working on it. The goal here is to have a datagrid in the jQ UI toolbax that's up to snuff with the likes of EXT and YUI. We've got some traction on that front, a couple people have offered to help. Let me know if you're in. --- Cheers all, Matt On Oct 4, 2:33 pm, Sharique [EMAIL PROTECTED] wrote: Really nice work. Did it works will asp.net as well? On Oct 4, 3:15 am, reconstrukt [EMAIL PROTECTED] wrote: Hey all, I just released Just finished the initial release of my datagrid plugin. I named her Ingrid. :) Features in this release: - resizable columns - paging toolbar - sorting (server-side) - row column styling The goal here is to give jQuery a robust, native datagrid that's up to snuff with those found in the EXT or YUI libraries. Check it out here:http://www.reconstrukt.com/ingrid/ Thanks much Matt
1 Love Story, 100 Days
to Singapore-Sex@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Singapore-Sex?hl=en -~--~~~~--~~--~--~---