XStandard + jQuery

Posted on March 29, 2011 at 2:37 PM in General, jQuery

We have used XStandard for many years now, and always used a JavaScript-free setup. When Firefox 4 came out, everything stopped working; the editor content was no longer being posted back to the server.

After being pointed in the right direction by Jon with XStandard Support (THANK YOU!), I rewrote the page to mix in JavaScript. Since I am a huge fan of jQuery, I wrote it up jQuery style.

  1. <script type="text/javascript">
  2. jQuery(document).ready(function(){
  3. jQuery("#formID").submit(function(){
  4. var $editor = jQuery("#entry_editor");
  5. var $alt = jQuery("#alt_entry_editor");
  6. var $body = jQuery("#entry_content");
  7. try
  8. {
  9. $editor.EscapeUnicode = true;
  10. $body.attr("value",$editor.val());
  11. }
  12. catch(er)
  13. {
  14. $body.attr("value",$alt.val());
  15. }
  16. });
  17. });
  18. </script>
  19. <object type="application/x-xstandard" name="entry_editor" id="entry_editor" width="95%" height="200">
  20. <param name="Value" value="" />
  21. <param name="CSS" value="http://domain.com/css/theme.css" />
  22. <param name="Styles" value="http://domain.com/scripts/xstd_styles.xml" />
  23. <param name="BorderColor" value="#ccc" />
  24. <param name="BackgroundColor" value="#ccc" />
  25. <textarea name="alt_entry_editor" id="alt_entry_editor" cols="40" rows="15"></textarea>
  26. </object>
  27. <input type="hidden" name="entry_content" id="entry_content" value="" />

And now, with XStandard + jQuery, things are working properly again. :-)

Comments
(Comment Moderation is enabled. Your comment will not appear until approved.)

On 3/30/11 at 1:37 PM, Phillip Senn said:

I've been threatening to write a specialized spreadsheet application for my users to post into a normalized SQL Server set of tables. Could XStandard be used for that?

On 3/30/11 at 7:45 PM, Matt Quackenbush said:

@ Phillip - I'm not quite sure how to answer your question, because I'm not quite sure what your scenario would be expecting out of XStandard. To the best of my knowledge, XStandard only generates XHTML markup based upon input. It sounds like you're wanting something that will build tabular data?

In the interest of full disclosure, it has been a _really_ long time since I have gone through the XStandard docs, so there might be something in there that would benefit you. But my guess is, unless you're wanting to generate XHTML markup, XStandard is probably not the tool you're looking for.

On 4/5/11 at 11:36 AM, Ben Nadel said:

Woot! XStandard :) That's been my editor of choice for years. I don't think I was ever able to get the automatic post-back working. Maybe it had trouble with IE (the browser I was using back when I started). As such, I have always been using a Javascript approach.

Still love the editor though! Unfortunately, I have found it to be a bit junky on the Mac. I use it on my VM box.

On 4/18/11 at 11:11 PM, James Beattie said:

Thanks, very helpful info!

What reason did they give for the javascript-free implementation breaking?

On 4/19/11 at 2:21 AM, Matt Quackenbush said:

@ Ben - Something junky on Mac?!?!?! Say it isn't so! ;-)

@ James - They didn't really give a reason for it breaking. About the only thing they said was that the non-JavaScript implementation is usually buggy except for in IE. Weird.

Back in the day, I was adamant that nothing should rely on JS, which is why I went with a non-JS implementation. Nowadays, though, it seems that pretty much every (well-used/liked) site on the planet requires JS in order to do much. As a result, I'm not quite the stickler that I once was about that. :-)

On 4/19/11 at 4:38 PM, Ben Nadel said:

@Matt, Ha ha :P
CodeBassRadio

Latest Articles

Eventually something really brilliant and witty will appear right here.

Calendar

May 2017
S M T W T F S
« Apr  
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Subscribe

Enter a valid email address.

The Obligatory Wish List