[jQuery] Re: TableSorter vs CMS
Thanks for the tips, but I'm confused. You're suggesting I use an AJAX callback function and initiate the PHP onSuccess. I searched for AJAX callback and onSuccess on JQuery's website but found no information about either one. I downloaded Firebug, but I'm not yet sure how to use it. It displays my webpage on top, with the source code appearing in a bottom panel. I don't see any obvious indications of JavaScript errors. Thanks. On Tue, Dec 9, 2008 at 2:31 PM, taylormade [EMAIL PROTECTED]wrote: I was having the same problem... It depends how you call the PHP... Best bet is using jquery's AJAX callback function and initiate the PHP onSuccess... i did the same thing here: (use firebug to explore the code): (everything in the tbody is print()'d by PHP... http://www.themeans.info/cms/galleryManager.php On Dec 9, 2:24 pm, David Blomstrom [EMAIL PROTECTED] wrote: With the help of this group, I got my first JQuery function to work - a combination sortable table columns/alternate row colors script. The only problem is that it works on my static page but not on a dynamic page in my content management system (PHP). The weird thing is that I copied the source code from a dynamic page into my static page, and it does work - but only on the static page. On my dynamic page, the sortable column function doesn't work at all. The zebra stripes function works only to the extent that any row I mouseover acquires a colored background. Does anyone have a hunch what's going on? Thanks. * * * * * script src=/1A/js/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/js/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); /script -- David Blomstrom Writer Web Designer (Mac, M$ Linux) www.geobop.org
[jQuery] Re: TableSorter vs CMS
There is a lot to grasp for you, but what you are doing is rather simple. Forget the AJAX callback and onSuccess. This is the answer to a common problem that you dont have, since your not using any AJAX. For firebug, you need to activate the console, and look there if there is no js error. then in the bottom line of the console, paste this: $('table').css('border','10px solid red'); If your table becomes red, then jquery is there. Otherwise, you to load jquery correctly, with the right path. Olivier On Wed, Dec 10, 2008 at 1:02 PM, David Blomstrom [EMAIL PROTECTED]wrote: Thanks for the tips, but I'm confused. You're suggesting I use an AJAX callback function and initiate the PHP onSuccess. I searched for AJAX callback and onSuccess on JQuery's website but found no information about either one. I downloaded Firebug, but I'm not yet sure how to use it. It displays my webpage on top, with the source code appearing in a bottom panel. I don't see any obvious indications of JavaScript errors. Thanks. On Tue, Dec 9, 2008 at 2:31 PM, taylormade [EMAIL PROTECTED]wrote: I was having the same problem... It depends how you call the PHP... Best bet is using jquery's AJAX callback function and initiate the PHP onSuccess... i did the same thing here: (use firebug to explore the code): (everything in the tbody is print()'d by PHP... http://www.themeans.info/cms/galleryManager.php On Dec 9, 2:24 pm, David Blomstrom [EMAIL PROTECTED] wrote: With the help of this group, I got my first JQuery function to work - a combination sortable table columns/alternate row colors script. The only problem is that it works on my static page but not on a dynamic page in my content management system (PHP). The weird thing is that I copied the source code from a dynamic page into my static page, and it does work - but only on the static page. On my dynamic page, the sortable column function doesn't work at all. The zebra stripes function works only to the extent that any row I mouseover acquires a colored background. Does anyone have a hunch what's going on? Thanks. * * * * * script src=/1A/js/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/js/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); /script -- David Blomstrom Writer Web Designer (Mac, M$ Linux) www.geobop.org
[jQuery] Re: TableSorter vs CMS
Which is why I figured the 'static' page worked - it omits the extra baggage that the CMS inserts. The offending code may not show up in a source view due to being dynamically linked-in when the page loads. Again, Firefox will come to the rescue, as you can view the 'generated source' if you have the 'Web Developer' plug in installed. On Dec 9, 11:09 pm, Michael Geary [EMAIL PROTECTED] wrote: All these debugging tips are very helpful. But the OP said that there were two versions of the page that in theory should be identical, except that one was a static HTML page and the other was generated by the CMS, and the static page works but the CMS page doesn't. If that is truly the case, then there is obviously some difference between the two versions of the page, and the problem has to be in that difference. Diffing the two versions as shown by View Source should reveal the problem immediately. Diffing is easier than debugging any day. :-) -Mike -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of donb Sent: Tuesday, December 09, 2008 6:57 PM To: jQuery (English) Subject: [jQuery] Re: TableSorter vs CMS My guess is that the 'CMS' inserts some onload code that interferes with your jQuery code that's supposed to run on page load. If you haven't already, get fthe Frefox browser and the Firebug addin. You will be able to step through the javascript as the page loads, to see what is actually happening. There's possible a javascript error occurring that you aren't even aware of, and again Firefox will let you see the details of any that DO occur. On Dec 9, 9:39 pm, David Blomstrom [EMAIL PROTECTED] wrote: What constitutes manipulation? It's a dynamic table, so I use PHP and a MySQL query to populate it with data. I removed a PHP script that gave each table row a class - though I didn't touch a similar touch that gives each table cell a class. At any rate, I'll replace the entire dynamic table script with a simple table from my source code tomorrow and see how that works. Thanks for the tip. On Tue, Dec 9, 2008 at 4:20 PM, MorningZ [EMAIL PROTECTED] wrote: Understanding $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); would go a long way to understanding why/how... That code gets executed *one single time*, when the page is pulled up and the DOM is ready if at some point after that, you manipulate #myTable, then the tablesorting functionality is *gone* and it will need to be wired up upon re-population...- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: TableSorter vs CMS
On Wed, Dec 10, 2008 at 4:14 AM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: There is a lot to grasp for you, but what you are doing is rather simple. Forget the AJAX callback and onSuccess. This is the answer to a common problem that you dont have, since your not using any AJAX. For firebug, you need to activate the console, and look there if there is no js error. OK, I activated Firebug's console, and it reports three errors: 1. xAddEventListener is not defined xAddEventListener(window, 'load', 2. $ is not defined $(document).ready(function() 3. xAddEventListener is not defined xAddEventListener(window, 'load', then in the bottom line of the console, paste this: $('table').css('border','10px solid red'); If your table becomes red, then jquery is there. Otherwise, you to load jquery correctly, with the right path. I pasted it in, but nothing turned red. When you say I have to load JQuery correctly, are you simply saying I need the correct path for my links to the JavaScript files? After doing this, I copied the source code, pasted it into my static test page, then repeated the process. This time Firebug lists just one error (the first error listed above). When I pasted the code into the bottom of the console, there was once again no effect; nothing turns red. However, the table on the static web page is working. The columns are sortable and they have alternating colors. Thanks. Olivier On Wed, Dec 10, 2008 at 1:02 PM, David Blomstrom [EMAIL PROTECTED] wrote: Thanks for the tips, but I'm confused. You're suggesting I use an AJAX callback function and initiate the PHP onSuccess. I searched for AJAX callback and onSuccess on JQuery's website but found no information about either one. I downloaded Firebug, but I'm not yet sure how to use it. It displays my webpage on top, with the source code appearing in a bottom panel. I don't see any obvious indications of JavaScript errors. Thanks. On Tue, Dec 9, 2008 at 2:31 PM, taylormade [EMAIL PROTECTED]wrote: I was having the same problem... It depends how you call the PHP... Best bet is using jquery's AJAX callback function and initiate the PHP onSuccess... i did the same thing here: (use firebug to explore the code): (everything in the tbody is print()'d by PHP... http://www.themeans.info/cms/galleryManager.php On Dec 9, 2:24 pm, David Blomstrom [EMAIL PROTECTED] wrote: With the help of this group, I got my first JQuery function to work - a combination sortable table columns/alternate row colors script. The only problem is that it works on my static page but not on a dynamic page in my content management system (PHP). The weird thing is that I copied the source code from a dynamic page into my static page, and it does work - but only on the static page. On my dynamic page, the sortable column function doesn't work at all. The zebra stripes function works only to the extent that any row I mouseover acquires a colored background. Does anyone have a hunch what's going on? Thanks. * * * * * script src=/1A/js/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/js/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); /script -- David Blomstrom Writer Web Designer (Mac, M$ Linux) www.geobop.org -- David Blomstrom Writer Web Designer (Mac, M$ Linux) www.geobop.org
[jQuery] Re: TableSorter vs CMS
I'm checking that right now. If the links to my style sheets are OK (and they are), then the links to my JavaScripts should be OK. However, there is aother possible problem that just occurred to me. I pasted my JQuery files in MySite, while the page I'm viewing is in MySite2. I essentially have several content management systems sharing includes from one master CMS. All my other JavaScript functions have worked correctly but maybe JQuery is different? I'll past the JQuery file into MySite 2, change the link and see if that makes a difference... On Wed, Dec 10, 2008 at 5:03 AM, James Hughes [EMAIL PROTECTED] wrote: if it saying - 2. $ is not defined jQuery isn;t included on the page correctly. Are your directory and file names alright? From: jquery-en@googlegroups.com on behalf of David Blomstrom Sent: Wed 10/12/2008 13:01 To: jquery-en@googlegroups.com Subject: [jQuery] Re: TableSorter vs CMS On Wed, Dec 10, 2008 at 4:14 AM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: There is a lot to grasp for you, but what you are doing is rather simple. Forget the AJAX callback and onSuccess. This is the answer to a common problem that you dont have, since your not using any AJAX. For firebug, you need to activate the console, and look there if there is no js error. OK, I activated Firebug's console, and it reports three errors: 1. xAddEventListener is not defined xAddEventListener(window, 'load', 2. $ is not defined $(document).ready(function() 3. xAddEventListener is not defined xAddEventListener(window, 'load', then in the bottom line of the console, paste this: $('table').css('border','10px solid red'); If your table becomes red, then jquery is there. Otherwise, you to load jquery correctly, with the right path. I pasted it in, but nothing turned red. When you say I have to load JQuery correctly, are you simply saying I need the correct path for my links to the JavaScript files? After doing this, I copied the source code, pasted it into my static test page, then repeated the process. This time Firebug lists just one error (the first error listed above). When I pasted the code into the bottom of the console, there was once again no effect; nothing turns red. However, the table on the static web page is working. The columns are sortable and they have alternating colors. Thanks. Olivier On Wed, Dec 10, 2008 at 1:02 PM, David Blomstrom [EMAIL PROTECTED] wrote: Thanks for the tips, but I'm confused. You're suggesting I use an AJAX callback function and initiate the PHP onSuccess. I searched for AJAX callback and onSuccess on JQuery's website but found no information about either one. I downloaded Firebug, but I'm not yet sure how to use it. It displays my webpage on top, with the source code appearing in a bottom panel. I don't see any obvious indications of JavaScript errors. Thanks. On Tue, Dec 9, 2008 at 2:31 PM, taylormade [EMAIL PROTECTED] wrote: I was having the same problem... It depends how you call the PHP... Best bet is using jquery's AJAX callback function and initiate the PHP onSuccess... i did the same thing here: (use firebug to explore the code): (everything in the tbody is print()'d by PHP... http://www.themeans.info/cms/galleryManager.php On Dec 9, 2:24 pm, David Blomstrom [EMAIL PROTECTED] wrote: With the help of this group, I got my first JQuery function to work - a combination sortable table columns/alternate row colors script. The only problem is that it works on my static page but not on a dynamic page in my content management system (PHP). The weird thing is that I copied the source code from a dynamic page into my static page, and it does work - but only on the static page. On my dynamic page, the sortable column function doesn't work at all. The zebra stripes function works only to the extent that any row I mouseover acquires a colored background. Does anyone have a hunch what's going on? Thanks. * * * * * script src=/1A/js/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/js/tablesorter/jquery.tablesorter.js
[jQuery] Re: TableSorter vs CMS
Does address/1A/js/jquery-1.2.6.min.js exist? Can you access it via the address bar in the browser? Check the Net tab of firebug and see the get request for the JS file - is the response a 404 or the contents of the file? James From: jquery-en@googlegroups.com on behalf of David Blomstrom Sent: Wed 10/12/2008 13:08 To: jquery-en@googlegroups.com Subject: [jQuery] Re: TableSorter vs CMS I'm checking that right now. If the links to my style sheets are OK (and they are), then the links to my JavaScripts should be OK. However, there is aother possible problem that just occurred to me. I pasted my JQuery files in MySite, while the page I'm viewing is in MySite2. I essentially have several content management systems sharing includes from one master CMS. All my other JavaScript functions have worked correctly but maybe JQuery is different? I'll past the JQuery file into MySite 2, change the link and see if that makes a difference... On Wed, Dec 10, 2008 at 5:03 AM, James Hughes [EMAIL PROTECTED] wrote: if it saying - 2. $ is not defined jQuery isn;t included on the page correctly. Are your directory and file names alright? From: jquery-en@googlegroups.com on behalf of David Blomstrom Sent: Wed 10/12/2008 13:01 To: jquery-en@googlegroups.com Subject: [jQuery] Re: TableSorter vs CMS On Wed, Dec 10, 2008 at 4:14 AM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: There is a lot to grasp for you, but what you are doing is rather simple. Forget the AJAX callback and onSuccess. This is the answer to a common problem that you dont have, since your not using any AJAX. For firebug, you need to activate the console, and look there if there is no js error. OK, I activated Firebug's console, and it reports three errors: 1. xAddEventListener is not defined xAddEventListener(window, 'load', 2. $ is not defined $(document).ready(function() 3. xAddEventListener is not defined xAddEventListener(window, 'load', then in the bottom line of the console, paste this: $('table').css('border','10px solid red'); If your table becomes red, then jquery is there. Otherwise, you to load jquery correctly, with the right path. I pasted it in, but nothing turned red. When you say I have to load JQuery correctly, are you simply saying I need the correct path for my links to the JavaScript files? After doing this, I copied the source code, pasted it into my static test page, then repeated the process. This time Firebug lists just one error (the first error listed above). When I pasted the code into the bottom of the console, there was once again no effect; nothing turns red. However, the table on the static web page is working. The columns are sortable and they have alternating colors. Thanks. Olivier On Wed, Dec 10, 2008 at 1:02 PM, David Blomstrom [EMAIL PROTECTED] wrote: Thanks for the tips, but I'm confused. You're suggesting I use an AJAX callback function and initiate the PHP onSuccess. I searched for AJAX callback and onSuccess on JQuery's website but found no information about either one. I downloaded Firebug, but I'm not yet sure how to use it. It displays my webpage on top, with the source code appearing in a bottom panel. I don't see any obvious indications of JavaScript errors. Thanks. On Tue, Dec 9, 2008 at 2:31 PM, taylormade [EMAIL PROTECTED] wrote: I was having the same problem... It depends how you call the PHP... Best bet is using jquery's AJAX callback function and initiate the PHP onSuccess... i did the same thing here: (use firebug to explore the code): (everything in the tbody is print()'d by PHP... http://www.themeans.info/cms/galleryManager.php On Dec 9, 2:24 pm, David Blomstrom [EMAIL PROTECTED] wrote: With the help of this group, I got my first JQuery function to work - a combination sortable table columns/alternate row colors script. The only
[jQuery] Re: TableSorter vs CMS
Wow, you were right - my link/path file was incorrect. I assumed it was OK because the links to my style sheets were OK, but there was a PHP error on the JavaScript link. I feel about bad about fueling such a lengthy discussion on a stupid mistake. If it's any consolation, I learned how to use Firebug (and got some other valuable tips besides). :) Thanks for all the help. On Wed, Dec 10, 2008 at 5:11 AM, James Hughes [EMAIL PROTECTED] wrote: Does address/1A/js/jquery-1.2.6.min.js exist? Can you access it via the address bar in the browser? Check the Net tab of firebug and see the get request for the JS file - is the response a 404 or the contents of the file? James From: jquery-en@googlegroups.com on behalf of David Blomstrom Sent: Wed 10/12/2008 13:08 To: jquery-en@googlegroups.com Subject: [jQuery] Re: TableSorter vs CMS I'm checking that right now. If the links to my style sheets are OK (and they are), then the links to my JavaScripts should be OK. However, there is aother possible problem that just occurred to me. I pasted my JQuery files in MySite, while the page I'm viewing is in MySite2. I essentially have several content management systems sharing includes from one master CMS. All my other JavaScript functions have worked correctly but maybe JQuery is different? I'll past the JQuery file into MySite 2, change the link and see if that makes a difference... On Wed, Dec 10, 2008 at 5:03 AM, James Hughes [EMAIL PROTECTED] wrote: if it saying - 2. $ is not defined jQuery isn;t included on the page correctly. Are your directory and file names alright? From: jquery-en@googlegroups.com on behalf of David Blomstrom Sent: Wed 10/12/2008 13:01 To: jquery-en@googlegroups.com Subject: [jQuery] Re: TableSorter vs CMS On Wed, Dec 10, 2008 at 4:14 AM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: There is a lot to grasp for you, but what you are doing is rather simple. Forget the AJAX callback and onSuccess. This is the answer to a common problem that you dont have, since your not using any AJAX. For firebug, you need to activate the console, and look there if there is no js error. OK, I activated Firebug's console, and it reports three errors: 1. xAddEventListener is not defined xAddEventListener(window, 'load', 2. $ is not defined $(document).ready(function() 3. xAddEventListener is not defined xAddEventListener(window, 'load', then in the bottom line of the console, paste this: $('table').css('border','10px solid red'); If your table becomes red, then jquery is there. Otherwise, you to load jquery correctly, with the right path. I pasted it in, but nothing turned red. When you say I have to load JQuery correctly, are you simply saying I need the correct path for my links to the JavaScript files? After doing this, I copied the source code, pasted it into my static test page, then repeated the process. This time Firebug lists just one error (the first error listed above). When I pasted the code into the bottom of the console, there was once again no effect; nothing turns red. However, the table on the static web page is working. The columns are sortable and they have alternating colors. Thanks. Olivier On Wed, Dec 10, 2008 at 1:02 PM, David Blomstrom [EMAIL PROTECTED] wrote: Thanks for the tips, but I'm confused. You're suggesting I use an AJAX callback function and initiate the PHP onSuccess. I searched for AJAX callback and onSuccess on JQuery's website but found no information about either one. I downloaded Firebug, but I'm not yet sure how to use it. It displays my webpage on top, with the source code appearing in a bottom panel. I don't see any obvious indications of JavaScript errors. Thanks. On Tue, Dec 9, 2008 at 2:31 PM, taylormade [EMAIL PROTECTED] wrote: I was having the same problem... It depends how you call the PHP... Best bet is using jquery's AJAX callback function and initiate the PHP onSuccess... i did the same thing here: (use firebug to explore the code): (everything in the tbody is print()'d by PHP... http://www.themeans.info/cms/galleryManager.php On Dec 9, 2:24 pm, David Blomstrom [EMAIL PROTECTED] wrote: With the help of this group, I got my first JQuery function to work
[jQuery] Re: TableSorter vs CMS
Never worry, if we never made mistakes we'd never learn. And it's great that Firebug is now your friend. James From: jquery-en@googlegroups.com on behalf of David Blomstrom Sent: Wed 10/12/2008 13:18 To: jquery-en@googlegroups.com Subject: [jQuery] Re: TableSorter vs CMS Wow, you were right - my link/path file was incorrect. I assumed it was OK because the links to my style sheets were OK, but there was a PHP error on the JavaScript link. I feel about bad about fueling such a lengthy discussion on a stupid mistake. If it's any consolation, I learned how to use Firebug (and got some other valuable tips besides). :) Thanks for all the help. On Wed, Dec 10, 2008 at 5:11 AM, James Hughes [EMAIL PROTECTED] wrote: Does address/1A/js/jquery-1.2.6.min.js exist? Can you access it via the address bar in the browser? Check the Net tab of firebug and see the get request for the JS file - is the response a 404 or the contents of the file? James From: jquery-en@googlegroups.com on behalf of David Blomstrom Sent: Wed 10/12/2008 13:08 To: jquery-en@googlegroups.com Subject: [jQuery] Re: TableSorter vs CMS I'm checking that right now. If the links to my style sheets are OK (and they are), then the links to my JavaScripts should be OK. However, there is aother possible problem that just occurred to me. I pasted my JQuery files in MySite, while the page I'm viewing is in MySite2. I essentially have several content management systems sharing includes from one master CMS. All my other JavaScript functions have worked correctly but maybe JQuery is different? I'll past the JQuery file into MySite 2, change the link and see if that makes a difference... On Wed, Dec 10, 2008 at 5:03 AM, James Hughes [EMAIL PROTECTED] wrote: if it saying - 2. $ is not defined jQuery isn;t included on the page correctly. Are your directory and file names alright? From: jquery-en@googlegroups.com on behalf of David Blomstrom Sent: Wed 10/12/2008 13:01 To: jquery-en@googlegroups.com Subject: [jQuery] Re: TableSorter vs CMS On Wed, Dec 10, 2008 at 4:14 AM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: There is a lot to grasp for you, but what you are doing is rather simple. Forget the AJAX callback and onSuccess. This is the answer to a common problem that you dont have, since your not using any AJAX. For firebug, you need to activate the console, and look there if there is no js error. OK, I activated Firebug's console, and it reports three errors: 1. xAddEventListener is not defined xAddEventListener(window, 'load', 2. $ is not defined $(document).ready(function() 3. xAddEventListener is not defined xAddEventListener(window, 'load', then in the bottom line of the console, paste this: $('table').css('border','10px solid red'); If your table becomes red, then jquery is there. Otherwise, you to load jquery correctly, with the right path. I pasted it in, but nothing turned red. When you say I have to load JQuery correctly, are you simply saying I need the correct path for my links to the JavaScript files? After doing this, I copied the source code, pasted it into my static test page, then repeated the process. This time Firebug lists just one error (the first error listed above). When I pasted the code into the bottom of the console, there was once again no effect; nothing turns red. However, the table on the static web page is working. The columns are sortable and they have alternating colors. Thanks. Olivier On Wed, Dec 10, 2008 at 1:02 PM, David Blomstrom [EMAIL PROTECTED] wrote: Thanks for the tips, but I'm confused. You're suggesting I use an AJAX callback function and initiate the PHP onSuccess. I searched for AJAX callback and onSuccess on JQuery's website but found no information about either one. I downloaded Firebug, but I'm not yet sure how to use it. It displays my
[jQuery] Re: TableSorter vs CMS
if it saying - 2. $ is not defined jQuery isn;t included on the page correctly. Are your directory and file names alright? From: jquery-en@googlegroups.com on behalf of David Blomstrom Sent: Wed 10/12/2008 13:01 To: jquery-en@googlegroups.com Subject: [jQuery] Re: TableSorter vs CMS On Wed, Dec 10, 2008 at 4:14 AM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: There is a lot to grasp for you, but what you are doing is rather simple. Forget the AJAX callback and onSuccess. This is the answer to a common problem that you dont have, since your not using any AJAX. For firebug, you need to activate the console, and look there if there is no js error. OK, I activated Firebug's console, and it reports three errors: 1. xAddEventListener is not defined xAddEventListener(window, 'load', 2. $ is not defined $(document).ready(function() 3. xAddEventListener is not defined xAddEventListener(window, 'load', then in the bottom line of the console, paste this: $('table').css('border','10px solid red'); If your table becomes red, then jquery is there. Otherwise, you to load jquery correctly, with the right path. I pasted it in, but nothing turned red. When you say I have to load JQuery correctly, are you simply saying I need the correct path for my links to the JavaScript files? After doing this, I copied the source code, pasted it into my static test page, then repeated the process. This time Firebug lists just one error (the first error listed above). When I pasted the code into the bottom of the console, there was once again no effect; nothing turns red. However, the table on the static web page is working. The columns are sortable and they have alternating colors. Thanks. Olivier On Wed, Dec 10, 2008 at 1:02 PM, David Blomstrom [EMAIL PROTECTED] wrote: Thanks for the tips, but I'm confused. You're suggesting I use an AJAX callback function and initiate the PHP onSuccess. I searched for AJAX callback and onSuccess on JQuery's website but found no information about either one. I downloaded Firebug, but I'm not yet sure how to use it. It displays my webpage on top, with the source code appearing in a bottom panel. I don't see any obvious indications of JavaScript errors. Thanks. On Tue, Dec 9, 2008 at 2:31 PM, taylormade [EMAIL PROTECTED] wrote: I was having the same problem... It depends how you call the PHP... Best bet is using jquery's AJAX callback function and initiate the PHP onSuccess... i did the same thing here: (use firebug to explore the code): (everything in the tbody is print()'d by PHP... http://www.themeans.info/cms/galleryManager.php On Dec 9, 2:24 pm, David Blomstrom [EMAIL PROTECTED] wrote: With the help of this group, I got my first JQuery function to work - a combination sortable table columns/alternate row colors script. The only problem is that it works on my static page but not on a dynamic page in my content management system (PHP). The weird thing is that I copied the source code from a dynamic page into my static page, and it does work - but only on the static page. On my dynamic page, the sortable column function doesn't work at all. The zebra stripes function works only to the extent that any row I mouseover acquires a colored background. Does anyone have a hunch what's going on? Thanks. * * * * * script src=/1A/js/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/js/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); /script -- David Blomstrom Writer Web Designer (Mac, M$ Linux
[jQuery] Re: TableSorter vs CMS
xAddEventListener is not defined== means there is a script using another libraries code. You hqave to remove that script, if your are not using it. If you do use it, you will have a conflict between jQuery and Prototype, both are using a $ function. In that case, have a look at how to run jQuery in noConflict mode. On Wed, Dec 10, 2008 at 2:01 PM, David Blomstrom [EMAIL PROTECTED]wrote: On Wed, Dec 10, 2008 at 4:14 AM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: There is a lot to grasp for you, but what you are doing is rather simple. Forget the AJAX callback and onSuccess. This is the answer to a common problem that you dont have, since your not using any AJAX. For firebug, you need to activate the console, and look there if there is no js error. OK, I activated Firebug's console, and it reports three errors: 1. xAddEventListener is not defined xAddEventListener(window, 'load', 2. $ is not defined $(document).ready(function() 3. xAddEventListener is not defined xAddEventListener(window, 'load', then in the bottom line of the console, paste this: $('table').css('border','10px solid red'); If your table becomes red, then jquery is there. Otherwise, you to load jquery correctly, with the right path. I pasted it in, but nothing turned red. When you say I have to load JQuery correctly, are you simply saying I need the correct path for my links to the JavaScript files? After doing this, I copied the source code, pasted it into my static test page, then repeated the process. This time Firebug lists just one error (the first error listed above). When I pasted the code into the bottom of the console, there was once again no effect; nothing turns red. However, the table on the static web page is working. The columns are sortable and they have alternating colors. Thanks. Olivier On Wed, Dec 10, 2008 at 1:02 PM, David Blomstrom [EMAIL PROTECTED] wrote: Thanks for the tips, but I'm confused. You're suggesting I use an AJAX callback function and initiate the PHP onSuccess. I searched for AJAX callback and onSuccess on JQuery's website but found no information about either one. I downloaded Firebug, but I'm not yet sure how to use it. It displays my webpage on top, with the source code appearing in a bottom panel. I don't see any obvious indications of JavaScript errors. Thanks. On Tue, Dec 9, 2008 at 2:31 PM, taylormade [EMAIL PROTECTED]wrote: I was having the same problem... It depends how you call the PHP... Best bet is using jquery's AJAX callback function and initiate the PHP onSuccess... i did the same thing here: (use firebug to explore the code): (everything in the tbody is print()'d by PHP... http://www.themeans.info/cms/galleryManager.php On Dec 9, 2:24 pm, David Blomstrom [EMAIL PROTECTED] wrote: With the help of this group, I got my first JQuery function to work - a combination sortable table columns/alternate row colors script. The only problem is that it works on my static page but not on a dynamic page in my content management system (PHP). The weird thing is that I copied the source code from a dynamic page into my static page, and it does work - but only on the static page. On my dynamic page, the sortable column function doesn't work at all. The zebra stripes function works only to the extent that any row I mouseover acquires a colored background. Does anyone have a hunch what's going on? Thanks. * * * * * script src=/1A/js/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/js/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); /script -- David Blomstrom Writer Web Designer (Mac, M$ Linux) www.geobop.org -- David Blomstrom Writer Web Designer (Mac, M$ Linux) www.geobop.org
[jQuery] Re: TableSorter vs CMS
Yes. I'm going to remove it. I think that's for another JS function I'd like to replace with JQuery. I'll make another post soon askng how to do it with JQuery if I can't figure it out. Thanks. On Wed, Dec 10, 2008 at 5:41 AM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: xAddEventListener is not defined== means there is a script using another libraries code. You hqave to remove that script, if your are not using it. If you do use it, you will have a conflict between jQuery and Prototype, both are using a $ function. In that case, have a look at how to run jQuery in noConflict mode. On Wed, Dec 10, 2008 at 2:01 PM, David Blomstrom [EMAIL PROTECTED] wrote: On Wed, Dec 10, 2008 at 4:14 AM, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: There is a lot to grasp for you, but what you are doing is rather simple. Forget the AJAX callback and onSuccess. This is the answer to a common problem that you dont have, since your not using any AJAX. For firebug, you need to activate the console, and look there if there is no js error. OK, I activated Firebug's console, and it reports three errors: 1. xAddEventListener is not defined xAddEventListener(window, 'load', 2. $ is not defined $(document).ready(function() 3. xAddEventListener is not defined xAddEventListener(window, 'load', then in the bottom line of the console, paste this: $('table').css('border','10px solid red'); If your table becomes red, then jquery is there. Otherwise, you to load jquery correctly, with the right path. I pasted it in, but nothing turned red. When you say I have to load JQuery correctly, are you simply saying I need the correct path for my links to the JavaScript files? After doing this, I copied the source code, pasted it into my static test page, then repeated the process. This time Firebug lists just one error (the first error listed above). When I pasted the code into the bottom of the console, there was once again no effect; nothing turns red. However, the table on the static web page is working. The columns are sortable and they have alternating colors. Thanks. Olivier On Wed, Dec 10, 2008 at 1:02 PM, David Blomstrom [EMAIL PROTECTED] wrote: Thanks for the tips, but I'm confused. You're suggesting I use an AJAX callback function and initiate the PHP onSuccess. I searched for AJAX callback and onSuccess on JQuery's website but found no information about either one. I downloaded Firebug, but I'm not yet sure how to use it. It displays my webpage on top, with the source code appearing in a bottom panel. I don't see any obvious indications of JavaScript errors. Thanks. On Tue, Dec 9, 2008 at 2:31 PM, taylormade [EMAIL PROTECTED]wrote: I was having the same problem... It depends how you call the PHP... Best bet is using jquery's AJAX callback function and initiate the PHP onSuccess... i did the same thing here: (use firebug to explore the code): (everything in the tbody is print()'d by PHP... http://www.themeans.info/cms/galleryManager.php On Dec 9, 2:24 pm, David Blomstrom [EMAIL PROTECTED] wrote: With the help of this group, I got my first JQuery function to work - a combination sortable table columns/alternate row colors script. The only problem is that it works on my static page but not on a dynamic page in my content management system (PHP). The weird thing is that I copied the source code from a dynamic page into my static page, and it does work - but only on the static page. On my dynamic page, the sortable column function doesn't work at all. The zebra stripes function works only to the extent that any row I mouseover acquires a colored background. Does anyone have a hunch what's going on? Thanks. * * * * * script src=/1A/js/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/js/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); /script -- David Blomstrom Writer Web Designer (Mac, M$ Linux) www.geobop.org -- David Blomstrom Writer Web Designer (Mac, M$ Linux) www.geobop.org -- David Blomstrom Writer Web Designer (Mac, M$ Linux) www.geobop.org
[jQuery] Re: TableSorter vs CMS
Don't feel bad! I am also somewhat chagrined that diffing the two versions of the page as I suggested probably wouldn't have helped in this case. :-) BTW, in addition to Firebug, do you also have the Web Developer Toolbar? It's probably the other most essential developer tool for Firebug. Go get it now if you don't have it, and take a look through all of its menus. A ton of good stuff there. -Mike _ From: David Blomstrom Wow, you were right - my link/path file was incorrect. I assumed it was OK because the links to my style sheets were OK, but there was a PHP error on the JavaScript link. I feel about bad about fueling such a lengthy discussion on a stupid mistake. If it's any consolation, I learned how to use Firebug (and got some other valuable tips besides). :) Thanks for all the help.
[jQuery] Re: TableSorter vs CMS
I do, though I've never really learned how to use it. I'll have to take a closer look at it. Opera is actually my default browser, though I love Firefox for all its extensions. * * * * * On Wed, Dec 10, 2008 at 9:23 AM, Michael Geary [EMAIL PROTECTED] wrote: Don't feel bad! I am also somewhat chagrined that diffing the two versions of the page as I suggested probably wouldn't have helped in this case. :-) BTW, in addition to Firebug, do you also have the Web Developer Toolbar? It's probably the other most essential developer tool for Firebug. Go get it now if you don't have it, and take a look through all of its menus. A ton of good stuff there. -Mike -- *From:* David Blomstrom Wow, you were right - my link/path file was incorrect. I assumed it was OK because the links to my style sheets were OK, but there was a PHP error on the JavaScript link. I feel about bad about fueling such a lengthy discussion on a stupid mistake. If it's any consolation, I learned how to use Firebug (and got some other valuable tips besides). :) Thanks for all the help. -- David Blomstrom Writer Web Designer (Mac, M$ Linux) www.geobop.org
[jQuery] Re: TableSorter vs CMS
Even though I'm going WAY off topic here, I'd like to stand up and give a great round of applause to the jQuery community. I started working with jQuery a few months back, and one of the things I really like about it is the dev community's willingness and readiness to not only answer questions about jQuery, but to also help devs who are struggling with the basic issues. Javascript libraries (and open source projects in general) are only as good as the community behind them. This is one of the reasons jQuery rocks! Oh...yeah...it's an incredibly powerful tool too! g I've learned a lot from threads like this one, and I hope to be able to add to the solutions as I get a better grasp on things. Thanks to all... --- Jim ---
[jQuery] Re: TableSorter vs CMS
I was having the same problem... It depends how you call the PHP... Best bet is using jquery's AJAX callback function and initiate the PHP onSuccess... i did the same thing here: (use firebug to explore the code): (everything in the tbody is print()'d by PHP... http://www.themeans.info/cms/galleryManager.php On Dec 9, 2:24 pm, David Blomstrom [EMAIL PROTECTED] wrote: With the help of this group, I got my first JQuery function to work - a combination sortable table columns/alternate row colors script. The only problem is that it works on my static page but not on a dynamic page in my content management system (PHP). The weird thing is that I copied the source code from a dynamic page into my static page, and it does work - but only on the static page. On my dynamic page, the sortable column function doesn't work at all. The zebra stripes function works only to the extent that any row I mouseover acquires a colored background. Does anyone have a hunch what's going on? Thanks. * * * * * script src=/1A/js/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/js/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); /script
[jQuery] Re: TableSorter vs CMS
The browser, its JavaScript interpreter, and jQuery have no idea whether your page is a static page or was generated dynamically. It's all the same by the time it gets to the browser. If one works and the other doesn't, there must be *some* difference in the HTML code delivered to the browser, or perhaps a difference in the headers. If you do a View Source on both the working static page and the broken dynamic page, and compare the two source files with a diff program such as Araxis Merge or WinDiff, it should show you what is different between the two. If the source appears identical, then check the headers. Somewhere in there must be the difference. If nothing turns up, post links to both versions of your page and somebody may be able to spot the problem. -Mike _ From: David Blomstrom With the help of this group, I got my first JQuery function to work - a combination sortable table columns/alternate row colors script. The only problem is that it works on my static page but not on a dynamic page in my content management system (PHP). The weird thing is that I copied the source code from a dynamic page into my static page, and it does work - but only on the static page. On my dynamic page, the sortable column function doesn't work at all. The zebra stripes function works only to the extent that any row I mouseover acquires a colored background. Does anyone have a hunch what's going on? Thanks. * * * * * script src=/1A/js/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/js/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); /script
[jQuery] Re: TableSorter vs CMS
Atz some point you've to sum up what is supposed to happen and isolate the faulty part. No js is running. the row mouseover is probably css. So you've to find out why. A wrong path to the jQuery files may be a guess. Anyway go through the different steps: -is jquery properly included (you may download the firefox extension jsview) -does the script contain errors (install firebug and activate it, use it) -has the table the same id as the the id selected by the script. If you dont understand that sentence, go to the jQuery website and learn there how selectors work, i.e the $() function. -check if the php generated table is correct. (install the tidy validator for firefox) with all that, you should gain some more autonomy. Olivier On Tue, Dec 9, 2008 at 11:24 PM, David Blomstrom [EMAIL PROTECTED]wrote: With the help of this group, I got my first JQuery function to work - a combination sortable table columns/alternate row colors script. The only problem is that it works on my static page but not on a dynamic page in my content management system (PHP). The weird thing is that I copied the source code from a dynamic page into my static page, and it does work - but only on the static page. On my dynamic page, the sortable column function doesn't work at all. The zebra stripes function works only to the extent that any row I mouseover acquires a colored background. Does anyone have a hunch what's going on? Thanks. * * * * * script src=/1A/js/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/js/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); /script
[jQuery] Re: TableSorter vs CMS
Understanding $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); would go a long way to understanding why/how... That code gets executed *one single time*, when the page is pulled up and the DOM is ready if at some point after that, you manipulate #myTable, then the tablesorting functionality is *gone* and it will need to be wired up upon re-population. On Dec 9, 6:21 pm, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: Atz some point you've to sum up what is supposed to happen and isolate the faulty part. No js is running. the row mouseover is probably css. So you've to find out why. A wrong path to the jQuery files may be a guess. Anyway go through the different steps: -is jquery properly included (you may download the firefox extension jsview) -does the script contain errors (install firebug and activate it, use it) -has the table the same id as the the id selected by the script. If you dont understand that sentence, go to the jQuery website and learn there how selectors work, i.e the $() function. -check if the php generated table is correct. (install the tidy validator for firefox) with all that, you should gain some more autonomy. Olivier On Tue, Dec 9, 2008 at 11:24 PM, David Blomstrom [EMAIL PROTECTED]wrote: With the help of this group, I got my first JQuery function to work - a combination sortable table columns/alternate row colors script. The only problem is that it works on my static page but not on a dynamic page in my content management system (PHP). The weird thing is that I copied the source code from a dynamic page into my static page, and it does work - but only on the static page. On my dynamic page, the sortable column function doesn't work at all. The zebra stripes function works only to the extent that any row I mouseover acquires a colored background. Does anyone have a hunch what's going on? Thanks. * * * * * script src=/1A/js/jquery-1.2.6.min.js type=text/javascript/script script src=/1A/js/tablesorter/jquery.tablesorter.js type=text/javascript/script script language=JavaScript type=text/JavaScript $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); /script
[jQuery] Re: TableSorter vs CMS
Thanks for all the tips, even if I don't understand all this stuff yet. :) Unfortunately, I got called in to work, so I'm away from my main computer. However, I'll try the things you suggested when I get home in the morning.
[jQuery] Re: TableSorter vs CMS
What constitutes manipulation? It's a dynamic table, so I use PHP and a MySQL query to populate it with data. I removed a PHP script that gave each table row a class - though I didn't touch a similar touch that gives each table cell a class. At any rate, I'll replace the entire dynamic table script with a simple table from my source code tomorrow and see how that works. Thanks for the tip. On Tue, Dec 9, 2008 at 4:20 PM, MorningZ [EMAIL PROTECTED] wrote: Understanding $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); would go a long way to understanding why/how... That code gets executed *one single time*, when the page is pulled up and the DOM is ready if at some point after that, you manipulate #myTable, then the tablesorting functionality is *gone* and it will need to be wired up upon re-population...
[jQuery] Re: TableSorter vs CMS
My guess is that the 'CMS' inserts some onload code that interferes with your jQuery code that's supposed to run on page load. If you haven't already, get fthe Frefox browser and the Firebug addin. You will be able to step through the javascript as the page loads, to see what is actually happening. There's possible a javascript error occurring that you aren't even aware of, and again Firefox will let you see the details of any that DO occur. On Dec 9, 9:39 pm, David Blomstrom [EMAIL PROTECTED] wrote: What constitutes manipulation? It's a dynamic table, so I use PHP and a MySQL query to populate it with data. I removed a PHP script that gave each table row a class - though I didn't touch a similar touch that gives each table cell a class. At any rate, I'll replace the entire dynamic table script with a simple table from my source code tomorrow and see how that works. Thanks for the tip. On Tue, Dec 9, 2008 at 4:20 PM, MorningZ [EMAIL PROTECTED] wrote: Understanding $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); would go a long way to understanding why/how... That code gets executed *one single time*, when the page is pulled up and the DOM is ready if at some point after that, you manipulate #myTable, then the tablesorting functionality is *gone* and it will need to be wired up upon re-population...- Hide quoted text - - Show quoted text -
[jQuery] Re: TableSorter vs CMS
All these debugging tips are very helpful. But the OP said that there were two versions of the page that in theory should be identical, except that one was a static HTML page and the other was generated by the CMS, and the static page works but the CMS page doesn't. If that is truly the case, then there is obviously some difference between the two versions of the page, and the problem has to be in that difference. Diffing the two versions as shown by View Source should reveal the problem immediately. Diffing is easier than debugging any day. :-) -Mike -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of donb Sent: Tuesday, December 09, 2008 6:57 PM To: jQuery (English) Subject: [jQuery] Re: TableSorter vs CMS My guess is that the 'CMS' inserts some onload code that interferes with your jQuery code that's supposed to run on page load. If you haven't already, get fthe Frefox browser and the Firebug addin. You will be able to step through the javascript as the page loads, to see what is actually happening. There's possible a javascript error occurring that you aren't even aware of, and again Firefox will let you see the details of any that DO occur. On Dec 9, 9:39 pm, David Blomstrom [EMAIL PROTECTED] wrote: What constitutes manipulation? It's a dynamic table, so I use PHP and a MySQL query to populate it with data. I removed a PHP script that gave each table row a class - though I didn't touch a similar touch that gives each table cell a class. At any rate, I'll replace the entire dynamic table script with a simple table from my source code tomorrow and see how that works. Thanks for the tip. On Tue, Dec 9, 2008 at 4:20 PM, MorningZ [EMAIL PROTECTED] wrote: Understanding $(document).ready(function() { $(#myTable).tablesorter({ widgets: ['zebra']} ); } ); would go a long way to understanding why/how... That code gets executed *one single time*, when the page is pulled up and the DOM is ready if at some point after that, you manipulate #myTable, then the tablesorting functionality is *gone* and it will need to be wired up upon re-population...- Hide quoted text - - Show quoted text -