windows 10 pro office 2019 pro office 365 pro windows 10 home windows 10 enterprise office 2019 home and business office 2016 pro windows 10 education visio 2019 microsoft project 2019 microsoft project 2016 visio professional 2016 windows server 2012 windows server 2016 windows server 2019 Betriebssysteme office software windows server instagram takipçi instagram beğeni instagram görüntüleme instagram otomatik beğeni facebook beğeni facebook sayfa beğenisi facebook takipçi twitter takipçi twitter beğeni twitter retweet youtube izlenme youtube abone instagram

ReferenceError: obj is not defined using webcomponents & polymer

Asked By: Anonymous

This is my first project using web components and I’m a rookie at best with js/jquery, so I am not sure why this happening.

I have a custom element built in “search-form.html”, all of my components and scripts are then brought in via a master “components.html” in the head of my index as such…


    <meta charset='utf-8'>  
    <a href="/static/template/js/webcomponents.min.js">/static/template/js/webcomponents.min.js</a>
    <link rel="import" href="/static/template/components/components.html">
    <link rel="icon" type="image/png" href="/static/template/img/favicon.png">


<link rel="import" href="/static/template/polymer/polymer.html">

<link rel="import" href="/static/template/components/scripts.html">
<!-- Loads jquery and other scripts -->

<link rel="import" href="/static/template/components/search-form.html">

then the search-form.html looks like this:

<!-- Defines element markup -->
<dom-module id="search-form">
    <div class="input-prepend input-append">
        <form id="search" method="get" action="/property/search">
            <div class="btn-group">
                <button id="search-type" class="btn btn-inverse dropdown-toggle" data-toggle="dropdown">
                    Search by
                    <span class="caret"></span>
                <ul class="dropdown-menu">
                    <li><a data-name="city" data-label="city">City</a></li>
                    <li><a data-name="zip" data-label="zip">Zip Code</a></li>
                    <li><a data-name="mls" data-label="mls">MLS Number</a></li>
            <input id="input-tag" class="input-xlarge" type="text" placeholder="Select a search type..." data-provide="typeahead" value="" />
            <button type="submit" class="btn"><i class="fa fa-search"></i></button>

var obj = {
    "city" : [],
    "zip" : [],

$(document).ready(function() {
    /*dynamic zipcode*/ 
    for(i=43000; i<=45999;i++){{val: i.toString(), string: i.toString()});
    for(i=48000; i<=49999;i++){{val: i.toString(), string: i.toString()});

$(function searchTag($) {   

    var data = [];

    $('.dropdown-menu > li > a').on("click", function() {
        data = $(this).data('name');

    var that = this;
        source: function(query, process) {
                var results =[data], function(value) {
                    return value.val;
        highlighter: function(val) {
            var value = _.find(obj[data], function(p) {
                return p.val == val;
            return value.string;
        updater: function(val) {
            var value = _.find(obj[data], function(p) {
                return p.val == val;
            return value.string;
    this.setSelected = function(value) {
        //$('#input-tag').attr('data-value', value.val);
        $('#input-tag').data('value', value.val);

$(function () {

    var caret = ' <span class="caret"></span>';

    function searchSelect() {
        $('.dropdown-menu > li > a').on("click", function() {
            $('#search-type').html($(this).text() + caret);
            $('#input-tag').attr('placeholder', $(this).data('label'));
            $('#input-tag').attr('name', $(this).data('label'));

        is: 'search-form',
        created: function() {},
        ready: function() {},
        attached: function() {},
        detached: function() {},
        attributeChanged: function(name, type) {}

so the var obj is declared in search-form.html

finally, because of the way our back end is written, I have to run a loop on index.html to get the array to be used in var obj for “city” : [],

that looks like this:

<!-- TMPL_LOOP Cities -->{val: "<!-- TMPL_VAR city_name -->", string: "<!-- TMPL_VAR city_name -->"})
<!-- /TMPL_LOOP -->

So now the problem. This all works without error in chrome, but I get the same error in FF, IE11, and Edge. That error is:

ReferenceError: obj is not defined{val: "ALLEN PARK", string: "ALLEN PARK"})

Man I hope I documented this well enough for someone to help, because I have been pulling my hair out for hours before turning to stack 🙂


Answered By: Anonymous

I think the imports are not loaded yet when you access the obj var in index.html, thus obj is undefined at this time. Since Chrome supports HTML imports natively, the imports are loaded earlier and it works there. Wrap the access to obj in HTMLImports.whenReady(callback). The callback will be called when all HTML imports have finished loading.

    <!-- TMPL_LOOP Cities -->{val: "<!-- TMPL_VAR city_name -->", string: "<!-- TMPL_VAR city_name -->"})
    <!-- /TMPL_LOOP -->

techinplanet staff

instagram volgers kopen volgers kopen buy windows 10 pro buy windows 11 pro

Windows 10 Kaufen Windows 10 Pro Office 2019 Kaufen Office 365 Lizenz Windows 10 Home Lizenz Office 2019 Home Business Kaufen windows office 365 satın al follower kaufen instagram follower kaufen porno
Alanya escort Manavgat escort Fethiye escort Kemer escort Didim escort Çanakkale escort Aydın escort Muğla escort Tekirdağ escort Manisa escort Balıkesir escort Trabzon escort Elazığ escort Ordu escort Kütahya escort Isparta escort Rize escort Kahramanmaraş escort Yalova escort Giresun escort Yozgat escort Tokat escort Şanlıurfa escort Sivas escort Batman escort Erzurum escort Sinop escort Kırşehir escort Karaman escort Kırıkkale escort Bolu escort Amasya escort Niğde escort Uşak escort Edirne escort Çorum escort Osmaniye escort Zonguldak escort Van escort Erzincan escort Söke escort Bodrum escort Çerkezköy escort Akhisar escort Bandırma escort Ayvacık escort Akçaabat escort Karakoçan escort Altınordu escort Tavşanlı escort Eğirdir escort Ardeşen escort Afşin escort Altınova escort Bulancak escort Sorgun escort Erbaa escort Viranşehir escort Zara escort Kozluk escort Aziziye escort Ayancık escort Kaman escort Ermenek escort Keskin escort Gerede escort Göynücek escort Bor escort Banaz escort Havsa escort Osmancık escort Bahçe escort Alaplı escort Başkale escort Kemah escort Nazilli escort Fethiye escort Çorlu escort Alaşehir escort Altıeylül escort Biga escort Araklı escort Kovancılar escort Fatsa escort Simav escort Yalvaç escort Çayeli escort Dulkadiroğlu escort Çiftlikköy escort Espiye escort Sarıkaya escort Niksar escort Suruç escort Yıldızeli escort Sason escort Horasan escort Boyabat escort Mucur escort Sarıveliler escort Yahşihan escort Göynük escort Gümüşhacıköy escort Çamardı escort Eşme escort İpsala escort Sungurlu escort Hasanbeyli escort Çaycuma escort İpekyolu escort Refahiye escort Kuşadası escort Marmaris escort Süleymanpaşa escort Turgutlu escort Susurluk escort Gelibolu escort Of escort Ünye escort Domaniç escort Fındıklı escort Elbistan escort Çınarcık escort Tirebolu escort Akdağmadeni escort Turhal escort Eyyübiye escort Suşehri escort Yakutiye escort Gerze escort Mengen escort Merzifon escort Ulukışla escort Sivaslı escort Keşan escort Kadirli escort Ereğli escort Özalp escort Tercan escort Efeler escort Didim escort Çine escort Dalaman escort Menteşe escort Milas escort Ortaca escort Seydikemer escort Ergene escort Kapaklı escort Malkara escort Salihli escort Şehzadeler escort Soma escort Yunusemre escort Ayvalık escort Bigadiç escort Burhaniye escort Gönen escort Karesi escort Çan escort Yenice escort Ortahisar escort Yomra escort Perşembe escort Pazar escort Onikişubat escort Pazarcık escort Türkoğlu escort Eynesil escort Görele escort Piraziz escort Yağlıdere escort Çayıralan escort Boğazlıyan escort Zile escort Siverek escort Karaköprü escort Haliliye escort Akçakale escort Şarkışla escort Gemerek escort Oltu escort Palandöken escort Mudurnu escort Suluova escort Taşova escort Toprakkale escort Kilimli escort Tuşba escort Üzümlü escort Gaziantep escort Denizli escort Adana escort Hatay escort Aydın escort İzmir escort Ankara escort Antalya escort Bursa escort İstanbul escort Kocaeli escort Konya escort Muğla escort Malatya escort Kayseri escort Mersin escort Samsun escort Sinop escort Tekirdağ escort Eskişehir escort Yalova escort Rize escort Amasya escort Balıkesir escort Çanakkale escort Bolu escort Erzincan escort Şırnak escort Van escort Yozgat escort Zonguldak escort Afyon escort Adıyaman escort Bilecik escort Aksaray escort Ağri escort Bitlis escort Siirt escort Çorum escort Burdur escort Diyarbakir escort Edirne escort Düzce escort Erzurum escort Kırklareli escort Giresun escort Kilis escort Kars escort Karabük escort Kırıkkale escort Mardin escort Kırşehir escort Maraş escort Manisa escort Muş escort Kastamonu escort Ordu escort Nevşehir escort Sakarya escort Osmaniye escort Şanliurfa escort Sivas escort Trabzon escort Tokat escort Ardahan escort Bartın escort Karaman escort Batman escort Bayburt escort Bingöl escort Elaziğ escort Gümüşhane escort Hakkari escort Isparta escort Uşak escort Igdır escort bursa escort bursa escort istanbul escort denizli escort düzce escort malatya escort erzincan escort zonguldak escort eskişehir escort gaziantep escort gaziantep escort gümüşhane escort hatay escort hatay escort ığdır escort gaziantep escort istanbul escort konya escort izmit escort kars escort escort adana escort bayan adıyaman escort bayan afyon escort bayan ağrı escort bayan aksaray escort bayan amasya escort bayan antalya escort bayan ankara escort bayan ardahan escort bayan artvin escort bayan aydın escort bayan balıkesir escort bayan bartın escort bayan batman escort bayan bayburt escort bayan bilecik escort bayan bingöl escort bayan bitlis escort bayan bolu escort bayan burdur escort bayan bursa escort bayan Çanakkale escort bayan Çankırı escort bayan Çorum escort bayan denizli escort bayan diyarbakır escort bayan düzce escort bayan edirne escort bayan elazığ escort bayan sivas escort bayan sinop escort bayan urfa escort samsun escort bayan sakarya escort bayan rize escort bayan osmaniye escort bayan ordu escort bayan niğde escort bayan nevşehir escort bayan muş escort bayan muğla escort bayan mersin escort bayan mardin escort bayan manisa escort bayan malatya escort bayan kütahya escort bayan konya escort bayan kocaeli escort bayan kırşehir escort bayan kırklareli escort bayan kırıkkale escort bayan kilis escort bayan kıbrıs escort bayan kayseri escort bayan kastamonu escort bayan kars escort bayan karaman escort bayan karabük escort bayan maraş escort izmit escort bayan izmir escort bayan istanbul escort bayan Isparta escort bayan Iğdır escort bayan hatay escort bayan hakkari escort bayan gümüşhane escort bayan giresun escort bayan gaziantep escort bayan eskişehir escort bayan erzurum escort bayan erzincan escort bayan tekirdağ escort bayan tokat escort bayan trabzon escort bayan uşak escort bayan van escort bayan yalova escort bayan yozgat escort bayan zonguldak escort bayan