ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Script tag being written as plain text

July 14, 2011 7:25pm

Subscribe [2]
  • #1 / Jul 14, 2011 7:25pm

    timmurtaugh

    12 posts

    Hi,

    I’m using a standard (it’s a new standard, but is already pretty common) method of calling a remote version of jQuery, and then calling a local file if the remote version fails for some reason. The code looks like this:

    <!-- Grab Google CDN's jQuery. fall back to local if necessary -->
    [removed][removed]
    [removed]window.jQuery || [removed]("[removed]\x3C/script>")[removed]

    When I put this into an ExpressionEngine template (or Snippet, or Global Variable), the system spits that third line (the local fallback) out as plain text. After some testing, it appears that EE is balking at the [removed] statement.

    This is my first time using EE 2.2.1, and I’m certain I’ve used this technique prior to now (having just checked I can say for certain I used it in version 2.1.0).

    Is this a bug?

  • #2 / Jul 14, 2011 7:27pm

    timmurtaugh

    12 posts

    Heh, of course the forum software has balked at my sample code. You can see it here: http://pastebin.com/5uuuzjMB

  • #3 / Jul 15, 2011 5:37am

    John Henry Donovan

    12339 posts

    Hi varenhorst and welcome to the forums 😊

    When did you install EE2.2.1?

    If it was before of July then please apply the following hotfixes

  • #4 / Jul 15, 2011 11:37am

    timmurtaugh

    12 posts

    It was last week, July 7th.

  • #5 / Jul 15, 2011 11:48am

    timmurtaugh

    12 posts

    Perhaps it’s also worth noting that some elements and pages (notably the “view” button on the Edit Template page, as well as any error pages, are missing some styling aspects. There are no errors in Safari’s console.

    Screenshot of “view” button: http://d.pr/2cp3

    Screenshot of error page: http://d.pr/nkiZ

    I don’t know if that’s related, but I suppose it could be.

  • #6 / Jul 17, 2011 3:02pm

    Lisa Wess

    20502 posts

    Hi, varenhost, in your linked code it shows this:

    \x3C/script>

    That final < seems to be encoded, meaning you don’t have a closing script tag.  Could it be that simple of a fix?, ie, making it < /script> (without the space)?

  • #7 / Jul 18, 2011 11:09am

    timmurtaugh

    12 posts

    Having a plain < /script> tag would break the script in some browsers — the encoded character avoids that, and hasn’t been a problem in any other site I’ve built.

    I just confirmed that this isn’t an issue in EE 2.1.3.

  • #8 / Jul 18, 2011 11:37am

    Lisa Wess

    20502 posts

    Hi, varenhost -

    Did you apply the hotfixes?  Those might be the what’s getting in your way here.

  • #9 / Jul 18, 2011 11:43am

    timmurtaugh

    12 posts

    I did not apply them since my installation has a build date of 20110705, the same as the hot fixes, and I downloaded and installed on the 7th, 2 days after the hotfixes were released.

  • #10 / Jul 18, 2011 11:45am

    Lisa Wess

    20502 posts

    Please do go ahead and apply those hotfixes, and see if that helps. 

    If not, please try switching between Debug 1, and Debug 2, and see if that changes the behavior.  We want you on 1, but I just want to see if that toggle changes anything for you. That’s in Admin > Output and Debugging Preferences.

  • #11 / Jul 18, 2011 11:51am

    timmurtaugh

    12 posts

    Ok, it’s working now, thanks.

    I guess my download didn’t have the hotfixes, despite having the latest build date?

  • #12 / Jul 18, 2011 11:54am

    Lisa Wess

    20502 posts

    Right, they’re incorporated now but may not have been at the time.  It’s a bit confusing, and we’re working on making a better process to avoid that in the future.

    So you’re all set now?

  • #13 / Jul 18, 2011 11:56am

    timmurtaugh

    12 posts

    I believe so yes.

  • #14 / Jul 18, 2011 12:30pm

    Lisa Wess

    20502 posts

    Awesome! I am sorry that you ran into this, but glad you’re up and running now.  If anything else comes up, please do start a new thread where we can help out.

    Thank you.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases