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.
- <script type="text/javascript">
- jQuery(document).ready(function(){
- jQuery("#formID").submit(function(){
- var $editor = jQuery("#entry_editor");
- var $alt = jQuery("#alt_entry_editor");
- var $body = jQuery("#entry_content");
- try
- {
- $editor.EscapeUnicode = true;
- $body.attr("value",$editor.val());
- }
- catch(er)
- {
- $body.attr("value",$alt.val());
- }
- });
- });
- </script>
- <object type="application/x-xstandard" name="entry_editor" id="entry_editor" width="95%" height="200">
- <param name="Value" value="" />
- <param name="CSS" value="http://domain.com/css/theme.css" />
- <param name="Styles" value="http://domain.com/scripts/xstd_styles.xml" />
- <param name="BorderColor" value="#ccc" />
- <param name="BackgroundColor" value="#ccc" />
- <textarea name="alt_entry_editor" id="alt_entry_editor" cols="40" rows="15"></textarea>
- </object>
- <input type="hidden" name="entry_content" id="entry_content" value="" />
And now, with XStandard + jQuery, things are working properly again. :-)
Latest Articles
- No recent entries.
Eventually something really brilliant and witty will appear right here.
Categories
- ColdBox (21) [RSS]
- ColdFusion (92) [RSS]
- Fusebox (3) [RSS]
- General (22) [RSS]
- jQuery (15) [RSS]
- Kalendar (1) [RSS]
- Linux (1) [RSS]
- Mura CMS (1) [RSS]
- Railo (1) [RSS]
- Rants (5) [RSS]
- Transfer (8) [RSS]
- Uni-Form Tag Library (36) [RSS]
Quick Links
Blogs I Read
Calendar
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
« Jan | ||||||
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 |
Subscribe
Enter a valid email address.
On 3/30/11 at 1:37 PM, Phillip Senn said:
On 3/30/11 at 7:45 PM, Matt Quackenbush said:
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:
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:
What reason did they give for the javascript-free implementation breaking?
On 4/19/11 at 2:21 AM, Matt Quackenbush said:
@ 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: