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.

Invalid EE conditional variable

June 09, 2014 3:58am

Subscribe [1]
  • #1 / Jun 09, 2014 3:58am

    Magnusvb

    57 posts

    Hi
    I have received some code to add a “widget” for booking a hotel room. The code is two part:

    1. html code

    <div  150px; border: 1px solid #ccc; background-color: #fff; padding: 15px; margin: 30px;"><div id="searchContainer" class="cb-widget"></div></div>

    2. Some javascript

    [removed]var easyAccessHotelsWidgetScriptLoaded = false;function easyAccessHotelsInitJQuery() {if (typeof (easyAccessHotelsOwnJQuery) == "undefined") {if (!easyAccessHotelsWidgetScriptLoaded) {easyAccessHotelsWidgetScriptLoaded = true;[removed]("<scr  + "ipt type=\"text/javascript\" src=\"//eaonline.citybreak.com/Content/widget/script/WidgetScripts.min.js\"></scr" + "ipt>");}setTimeout("easyAccessHotelsInitJQuery()", 50);}else {var baseUrl = "//eaonline.citybreak.com/widget/GetWidgetSearchFormMultipleRooms";(function ($) {$.getJSON(baseUrl + "?channelId=f585a68f-c601-4f40-8490-8e086a5d873d&openOpti; (json) {$("#searchContainer").html(json.Widget);});})(easyAccessHotelsOwnJQuery);}}easyAccessHotelsInitJQuery();[removed]

    But if I add that to the page, I get this error:

    A PHP Error was encountered

    Severity: User Warning
    Message: Invalid EE Conditional Variable: {if (typeof (easyAccessHotelsOwnJQuery) == "undefined") {if (!easyAccessHotelsWidgetScriptLoaded) {easyAccessHotelsWidgetScriptLoaded = true;[removed]("");}
    Filename: libraries/Functions.php
    Line Number: 2640

    The page use embedded templates for the html head and the footer. If I create a straight up, simple html page with no embedded templates, the code works with no errors.

    Anyone know how to solve this?

    Best regards, Magnus

    *UPDATE*
    Looks like it was an error in the javascipt:
    - Only two == characters (changed that to three: === )
    - One parantes to many at the end of the file

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

ExpressionEngine News!

#eecms, #events, #releases