I am having a strange problem when these three things come together:
Windows Internet Explorer
Jquery
Xstandard(wysiwyg editor)

The problem concerns the word 'function'.  Whenever the xstandard component
has the word function in it, in plain text, the javascript fails and my app
saves nothing.  Remove the word function and all is fine.

I don't have this problem on the mac in any browser, or in firefox on the
PC, just in IE (7).

My script:

function xSwap() {
        // if form has a class of xstandard and contains a text area with class 
of
xstandard, then replace text areas with xstanard object
        var xstandardSrc;
        $('form.xstandard textarea.xstandard').each(function(i) { 
                xstandardSrc = "<object type='application\/x-xstandard' id='XS";
                xstandardSrc += $(this).attr("name");
                xstandardSrc += "' width='100%' height='200'
codebase='http:\/\/www.elxr.co.uk\/elxr\/XStandard.cab#Version=1,7,0,0'>";
                xstandardSrc += '<param name="Toolbar"
value="numbering,bullets,data-table,image,line, hyperlink,undo,source" />'
                xstandardSrc += '<param name="Value" value="'
                xstandardSrc += $(this).text();
                xstandardSrc += '" \/>';
                xstandardSrc += "<param name='CSS' value='"
                xstandardSrc += $('[EMAIL PROTECTED]').attr('content')
                xstandardSrc += "\/custom\/xstandard\/xstandard.css' \/>";
                xstandardSrc += "<param name='Styles' value='";
                xstandardSrc += $('[EMAIL PROTECTED]').attr('content');
                xstandardSrc += "\/custom\/xstandard\/xstandard-styles.xml' 
\/>";
                xstandardSrc += "<param name='Base' value='";
                xstandardSrc += $('[EMAIL PROTECTED]').attr('content');
                xstandardSrc += "\/' \/>";
                xstandardSrc += "<param name='EscapeUnicode' value='true' />"
                xstandardSrc += "<\/object>";
                xstandardSrc += "<input type='hidden' value='' name='";
                xstandardSrc += $(this).attr("name");
                xstandardSrc += "'>";
                $(this).before(xstandardSrc);
                $(this).remove();
        });
        // attach submit function to every xstandard form, 
        $('form.xstandard').submit(function() {
                $('[EMAIL PROTECTED]').each(function(){
                        var obID = $(this).attr('id').replace(/XS/g,'');
                        $('[EMAIL PROTECTED]' + obID + ']').val($(this).val());
                });
        });
}

On submit jquery reads the text xstandard object and copys the data to a
hidden form field, which is submitted to a form processor.

Does anyone have any ideas?  The reason is suspect that my javascript is not
right is because of the word function.  I suspect that the text is not being
encoded properly somewhere along the line.

I have narrowed it down to this line:

$('[EMAIL PROTECTED]' + obID + ']').val($(this).val());

right near the bottom.  the word function is being resolved by
$(this).val().

Any help would be appreciated.

Marc

-- 
View this message in context: 
http://www.nabble.com/Strange-problem-with-the-word-function-tf3167047.html#a8785497
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to