jquery,jquery-ui,autocomplete,jquery-autocomplete,underscore.jsRelated issues-Collection of common programming errors
MPD
7 jquery admin-theme
I have installed jQuery Update but it breaks some core functionality that makes the admin UI a struggle to deal with. Is there a way to keep jQuery Update enabled but disable it when the admin theme is visible?
Jamal
jquery plugin twitter
I’ve been working on a jQuery plugin for pulling tweets since the v1 endpoints were all closed off and you need oAuth now. This is just the jQuery part but if you want to see the php behind it I’ll be happy to post. But basically, I’d love suggestions, as this is one of the first real plugins i’ve made, i’m really looking for critique on patterns and efficiency. Is there anything I’m doing that can be shorten’d significantly? Is there a feature you think would be cool for me to include?And just
Jamal
javascript jquery datetime plugin twitter
I’ve built a Twitter plugin recently and was wondering if I could get some feedback on it. There is also a PHP side that grabs the actual tweets and I can post that code if it’s needed.http://jsfiddle.net/cKfDd/;(function ( $, window, document, undefined ) { /************************************* Plugin Functions *************************************/ /*************************************/ Plugin.prototype.init = function () {var params = [ ‘?user=’ + this.options.user,’&limit=’
laxman
php jquery ajax wordpress woocommerce
I am getting catchable fatal error in bellissima themeforest woocommerce theme.http://www.pursesgalore.com.au/ can anyone help on this?Code:if(!$dst_h) ://can’t resize, so return original url$img_url = $url;$dst_w = $orig_w;$dst_h = $orig_h;————————–line number 1040 ———————–else ://else check if cache existsif(file_exists($destfilename) && getimagesize($destfilename)) {$img_url = “{$upload_url}{$dst_rel_path}-{$suffix}.{$ext}”;} Error: Catchable fatal erro
Fran Verona
php javascript jquery ajax
I have a PHP file with the following code:<html><head><!– HEAD –><?php require_once ‘Language.php’; ?></head><body><script type=”text/javascript”>$.get(‘step2.php’,function(data){// Do something});</script></body> </html>As you can see, I’m trying to load some content via Ajax call. The problem is that step2.php contains some PHP code:<div class=”step-content table-bordered”><h3><?php echo $Lang->get(‘create_s2_title
Tom
jquery ajax joomla joomla2.5
Still having problems figuring out how to use Ajax and the Joomla framework together. I’ve created a Joomla component which I can access with:index.php?option=com_mycomponentI’m using Jquery with Ajax in components/com_mycomponent/views/mycomponent/tmpl/default.php:<?php // No direct access to this file defined(‘_JEXEC’) or die(‘Restricted access’); ?> <html> <head><title>Ajax with jQuery Example</title><script language=”javascript” type=”text/javascript” src=”ht
Asenar
javascript php jquery callback
i have make an php editor with so much effort but i cant print the fatal error. and want to print the fatal error. How to do this. I have code for run the php through eval function here is my jsfiddle – **http://jsfiddle.net/3c7F6/3/** I want to print an fatal error. Please help me to do this.please check the code and give me the suggestion
Ulker Ibrahimova
javascript jquery file-get-contents
This question already has an answer here:Ways to circumvent the same-origin policy11 answersIs there any way to get full page source of snother different site? Example my site is example.com but i want to get facebook’s page source on example.com. I tired this one: http://phpjs.org/functions/file_get_contents/ And it gives me null. So anyone knows it?function file_get_contents (url, flags, context, offset, maxLen) {// Read the entire file into a string//// version: 906.111// discuss at: http://
Mitesh Vora
jquery html css ellipsis
I tried looking here Insert ellipsis (…) into HTML tag if content too wide but could not get in chrome to work. I there solution for multiline in all browsers??
Ronald Yeung
javascript jquery ajax json cors
What I am trying to do is to have a page on the HTTP protocol sending an AJAX call to the same Web server but using HTTPS. Both the requesting page and the AJAX handler are on the same server, having the same domain and port. (I.e., only difference is the protocol.) To illustrate,Fromhttp://www.example.com/index.phpTriggers a jQuery AJAX call tohttps://www.example.com/authenticate.php?user=123&password=456(I am hoping to pass the password through HTTPS to make it encrypted over the Internet.
lokisapocalypse
jquery jquery-ui accordion sortable
This is my first time posting so please let me know if I fail to provide enough details. I have a page that contains multiple accordions. I wanted to use multiple accordions because I wanted users to be able to have multiple sections open at once which is not native to accordion. I also want users to be able to sort those accordions. The way the page is currently set up, users can sort the accordion with no problems. When the user goes to sort the accordions, I have a script that will close all
Akke
javascript jquery jquery-ui dialog callback
I’m writing some form validation functions, and I’ve decided to go with jQueryUI for prompting the user because of flexibility.There is a slight problem tho. I want my functions to return an array which consists of a boolean and a string for my error reporting system. JQueryUI dialogs are asynchronous which means the browser won’t hang and wait for a return value as the native prompt() would.Here is some sample code:Validator function:function verifyTOS_PVM_v2() {verifyTOS_PVM_v2_callback = ”;i
Richard Neil Ilagan
jquery jquery-ui position
jQuery has a native .position() function right out of the box which gets positioning values of an element relative to its location on the page.jQuery UI extends that same function to allow modification of positioning of elements.How do I check if the jQuery UI version of .position() is loaded in a page?Sadly, it isn’t just a matter of checking whether jQuery UI is loaded on a page or not, since the .position() plugin extension is not part of the jQuery UI Core libraries, which means someone some
UrbanPlanet
jquery jquery-ui autocomplete asp.net-mvc-4
List itemI am looking at the JQUERY example on the http://jsfiddle.net/g4stL/212/ link in Jsfiddle website. I am very impressed by the feature. Infact we have to implement the exact same feature on our application.If I copy the code as it is, I am able to see the multicolumn autocomplete. However the selection part does not work. If I select using mouse cursor or using Arrow keys the program fails. The error I get is “htmlfile: Unexpected call to method or property access.”In the append function
Mark Richman
asp.net jquery jquery-ui dialog confirm
I have a TemplateField in a GridView in an UpdatePanel with a button called btnDelete. Rather than the standard OnClientClick=”return confirm(‘Are you sure?’)” I’d like to use jQuery Dialog.So far, I’m able to set the jQuery using btnDelete.Attributes[“onclick”] and setting the jQuery Dialog code in the code-behind. However, it posts back to the server in all cases before I have a chance to click “Confirm” or “Cancel”. Here is the HTML it produces:<input type=”submit” rel=”Are you sure?” clas
Iznogood
jquery jquery-ui jquery-ui-accordion
I have a very simple accordion in my webpage that I initialise with :$(document).ready(function() {$(‘#accordion’).accordion({‘autoheight’:true,’header’: ‘img’});});And later I:<div id=”accordion”><img src=”/public/images/btn_avant.gif” alt=”” /><div><ul><li><a href=”/”>link</a></li><li><a href=”/”>link</a></li></ul></div><img src=”/public/images/btn_pendant.gif” alt=”” /><div>du contenu</div>&l
alex.mo.07
javascript jquery html jquery-ui this
I’m working on what I thought would be a simple chunk of code, trying to dynamically (using ‘this’) animate div blocks to scale (zoom) to the size of the parent container (section tag) on click.My HTML:<section><div id=”project”></div><div id=”project”></div><div id=”project”></div><div id=”project”></div><div id=”project”></div><div id=”project”></div></section>My JavaScript:$(“#project”).click(function() {$(thi
James Montagne
javascript jquery-ui
see the underlying code.function displayProductsByCategory(a){$.getJSON(‘json/newjson.json’, function(data) {$(“#Product_Display_Div”).empty();$(“#Product_Display_Div”).append(‘<h1>’+a.id+'</h1>’);$.each(data[a.id], function(key, item) {//alert(“key :”+item.productPrice+”value :”+item.productName);$(“#Product_Display_Div”).append(‘<ul class=”columns”><li> <h3>’+item.productName+'</h3><img src=”‘+item.ProductImageURL+'” width=”150″ height=”150″ /><p>
Andrew Whitaker
jquery-ui autocomplete jquery-ui-autocomplete
I’m using jQuery UI’s Autocomplete slightly differently than it was probably created to do.Basically I want to keep all the same functionality, the only difference is that when the suggestion box appears, I don’t the suggestion box to hide when a user makes a selection and I also don’t want that selection to populate the input box that .autocomplete is attached to.So, I’ve been reading through the jQuery UI documentation, and it appears there is a way to disable the Select: and Close: events, bu
revaxarts
jquery jquery-ui jquery-ui-sortable
I’m trying to load some html in an iframe and make certain elements in that html page sortable:jsfiddleJS:var _iframe = $(‘iframe’); var containment = _iframe.contents().find( “modules” ); if(containment.data(‘sortable’)) containment.sortable(‘destroy’);containment.sortable({stop: function (event, ui) {console.log(‘STOP: I am never called’);},start: function (event, ui) {console.log(‘START: I am called with a delay!’);},containment: containment,placeholder: “sortable-placeholder”,items: “> mo
user2642201
android autocomplete nullpointerexception searchview
I’m trying to implement autocomplete textview functionality to my searchview since i find it easy as compared to content providers.The problem is that I’m getting nullpointerexception at autoComplete.setAdapter(aAdapter).This is part of my code: Records.javapublic class Records extends Fragment{String Name;GridView MyGrid;List<String> array=new ArrayList<String>();ArrayList<String> Location=new ArrayList<String>();ArrayList<String> Books=new ArrayList<String>(
MPelletier
android autocomplete textview logcat
I am using autoCompleteTextView to load the contacts. There is no errors and it doesnt crash too. But the autocompleteTextview doesn’t seem to appear anything.I will post my codes and logcat.Codes:-package com.droidnova.android.samples;import android.app.Activity;import android.content.ContentResolver;import android.content.Context;import android.database.Cursor;import android.net.Uri;import android.os.Bundle;import android.provider.Contacts;import android.provider.Contacts.People;import android
user3346237
android autocomplete google-places-api google-maps-api-2
I’m using Google Places Autocomplete API in my application. I followed this tutorial http://wptrafficanalyzer.in/blog/adding-google-places-autocomplete-api-as-custom-suggestions-in-android-search-dialog/ but when i write the place name in search box, it doesn’t retrieves the suggestions and when I press Go button, my app crashes. Please HelpLog File03-10 16:51:56.383: E/ActivityThread(25238): Failed to find provider info for com.appscourt.earth.map.PlaceProvider 03-10 16:51:58.798: E/ActivityThr
Clive
7 autocomplete
I’m kind of new to drupal (been working with it for 2 months) and i seem to hit a wall with this issue . I’ve written a little module to allow my users to find phone numbers quickly . It uses autocomplete and works perfectly fine when the user is logged in , but fail when it ain’t the case (no icon in the field no http requests fired).Digging a little further , i can see that neither the autocomplete.js is loading nor the targeted field is properly formatted for autocomplete .<form action=”/”
UrbanPlanet
jquery jquery-ui autocomplete asp.net-mvc-4
List itemI am looking at the JQUERY example on the http://jsfiddle.net/g4stL/212/ link in Jsfiddle website. I am very impressed by the feature. Infact we have to implement the exact same feature on our application.If I copy the code as it is, I am able to see the multicolumn autocomplete. However the selection part does not work. If I select using mouse cursor or using Arrow keys the program fails. The error I get is “htmlfile: Unexpected call to method or property access.”In the append function
user361022
jquery autocomplete
At first, I thought this should be very easy. Just use $(selector).val() to get the value. However, I got a lot of difficulties.Allow me to make an example.Assume that I have two text boxes, and they are attached to jQuery’s AutoComplete plugin.When I click on the first textbox, I make ajax call, when success, I bind the returned data into that clicked textbox, and a hiddenField, which is used to hold the returned ID.The whole progress is easy, I make the ajax call and goes successful. The hidde
Fabrício Matté
jquery autocomplete
I’m trying to implement this web api autocomplete in a standard mvc app. http://techbrij.com/987/jquery-ui-autocomplete-asp-net-web-apiHere’s a screen grab from Firebug http://sdrv.ms/N0WkHPI’ve created a controller method and added the jquery script, but I keep getting a ‘JSON.parse: unexpected character’ error. I don’t see any unusual characters in my data.$(document).ready(function () { $(‘#txtSearch3’).autocomplete({source: function (request, response) {$.ajax({url: ‘/home/Get’,type: ‘GET’,c
DaveRandom
jquery asp.net ajax asp.net-mvc autocomplete
I’m using asp.NET MVC, and am looking at the JQuery autocomplete plugin for what I want to do. I need some extra functionality that I don’t think it provides.I have a page with two text fields, First and Last name. Ideally, when someone begins typing into either, I would like autocomplete to display both the first and last name of all matches. If one of these matches were selected, I would like only the appropriate (first/last) name to go into the current field, while the other field is also fil
Andrew Whitaker
jquery-ui autocomplete jquery-ui-autocomplete
I’m using jQuery UI’s Autocomplete slightly differently than it was probably created to do.Basically I want to keep all the same functionality, the only difference is that when the suggestion box appears, I don’t the suggestion box to hide when a user makes a selection and I also don’t want that selection to populate the input box that .autocomplete is attached to.So, I’ve been reading through the jQuery UI documentation, and it appears there is a way to disable the Select: and Close: events, bu
JackTurky
ajax json jquery-ui autocomplete
my problem is clear.I’m using jquery autocomplete and i don’t know why it shows me only the message:9 results are available, use up and down arrow keys to navigate.Without showing me the list of result.This is my code:<p class=”select-c”><label for=”fcb”>Location</label><input id=”fcb” name=”fcb” type=”text”> </p>$(“#fcb”).autocomplete({source: function (request, response) {$.ajax({type: “GET”,dataType: ‘json’,url: “../ws/city/” + request.ter
pal
jquery jquery-autocomplete
I have ASP.Net webservice being called in JQuery and the response in the drop down comes in JSON format. Below is the snippet$(document).ready(function () { $(“#txtTest”).autocomplete({ source: function (request, response) { $.ajax({ type: “POST”, contentType: “application/json; charset=utf-8”, url: “Webservice.asmx/GetNames”,data: “{‘prefix’:'” + request.term + “‘}”, dataType: “json”, async: true, success: function (data){ response($.map(data, function(item){ /*Below commented return ha
Benjamin
jquery jquery-autocomplete
var projects2 = <?php include_once “AutoCompleteHandler.php”; ?>;var projects23= <?php include_once “AutoCompleteHandler.php”; ?>;$(“#p_name”).autocomplete({minLength: 2,source: projects2,focus: function(event, ui) {$(“#p_name”).val(ui.item.label);return false;},select: function(event, ui) {return false;}}).data(“ui-autocomplete”)._renderItem = function(ul, item) {return $(“<li>”).append(“<a>” + item.label + “/” + item.p_gender + “/” + item.p_age + “</a>”).appendTo(
mburm
jquery vb.net jquery-ajax jquery-autocomplete ashx
I use a jQuery autocomplete with an ASHX as source. But every request throws an error with number 200.My JavaScript:$(function () {$(‘#username input[type = “text”]’).autocomplete({source: function (request, response) {$.ajax({url: “UserName.ashx?term=” + request.term,dataType: “json”,type: “POST”,success: function (data) {response($.map(data, function (item) {return {label: item.Value}}))},error: function (xhr, ajaxOptions, thrownError) {alert(xhr.status);alert(thrownError);}});}}); });The HTML
Dogbert
ruby-on-rails jquery-autocomplete
I have the json in following format.[{“tag”:{“name”:”& Awards”,”id”:142}},{“tag”:{“name”:”& Bisexual Bars”,”id”:207}},{“tag”:{“name”:”& Clubs”,”id”:40}},{“tag”:{“name”:”& Imaging”,”id”:1188}}}and am using the following code$(“#tags_name”).autocomplete({source: “/companies/autocomplete_tags2.json”,width: 320,dataType: ‘json’,highlight: false,scroll: true,scrollHeight: 300,parse: function(data) {var array = new Array();for(var i=0; i < data.tag.length; i++){array[i] = {data: dat
pal
jquery jquery-autocomplete
I am working on the JQuery Autocomplete using ASP.Net webservice. I have ASP.Net webservice being called in JQuery (JSON) drop down as$(document).ready(function () {$(“#txtTest”).autocomplete({ source: function (request, response) { $.ajax({ type: “POST”, contentType: “application/json; charset=utf-8”, url: “Webservice.asmx/GetNames”,data: “{‘prefix’:'” + request.term + “‘}”, dataType: “json”, async: true, success: function (data){ response($.map(data, function(item){ return item ; }));
pal
jquery jquery-autocomplete
Can you please help me on how to get the value of the selected item in autocomplete drop down? I am able to populate the data and i want to get the value of the selected item alone. Below is the snippet i am using.$(document).ready(function () { $(“#txtTest”).autocomplete({ source: function (request, response) { $.ajax({ type: “POST”, contentType: “application/json; charset=utf-8”, url: “Webservice.asmx/GetNames”,data: “{‘prefix’:'” + request.term + “‘}”, dataType: “json”, async: true, suc
Mike
jquery limit jquery-autocomplete
I am using the following code:$(function(){$(“.aucomplete”).live(“keyup”, function(){var all_analysts = [<TMPL_VAR ALL_TARGETS>];$(this).autocomplete({source: all_analysts, //local lookup valuesdelay: 0});});});and “ALL_TARGETS” contains a string like: ‘X’,’Y’,’Z’.When limiting the string to 1000 items, everything works fine. When limiting the string to 5000 items, aucomplete doesn’t work and on chrome I get the following error: “Uncaught SyntaxError: Unexpected string” (under the “var all
Himberjack
javascript jquery autocomplete jquery-autocomplete
I am using Jquery autocomplete with local array of size ~5000, every word is ~10 chars. I am initializing the object like this:.autocomplete({matchContains: true, minLength: 3, delay: 700, source: array1, max: 10, highlight: true })The problem is, that when I start to type, it takes a lot of time (sometime crashes the browser) until the result is displayed.What can I do?Thanks
Matt
jquery jquery-autocomplete
Please see my example in http://jsfiddle.net/7c84b/ Without EasyUI, auto complete works fine. But when adding EasyUI js in, auto complete not work any more.Please help how to make them work together peacefully.
Matt Tew
jquery google-chrome jquery-autocomplete
I am using jQuery autocomplete. I use it all the time without problems. However, in this particular instance, the results are retrieved successfully, but as soon as the options are displayed on the page, the tab crashes completely, with Chrome’s dead tab page.This only happens in Google Chrome.The problem may, I guess, be unrelated to (but co-incidentally triggered by) the Autocomplete, but in case I am missing something in my Autocomplete code, here it is;content.find(“.saleLine input[name=’i
DrHall
javascript underscore.js
The site I am working on is using backbone and underscore in conjunction to render out page elements from data pulled out of a JSON file. Everything was working fine and dandy across all browsers, until I set IE to test in compatibility mode for IE 9. (I am not test in a native IE 9 enviortment – rather using the IE 10 developer window and setting browser mode for IE9 and Document Mode for IE9 standards).The error is specifically:SCRIPT1002: Syntax Errorwith a pointer to the throw e; line of the
bento
backbone.js filtering underscore.js
I’m attempting to learn backbone.js and (by extension) underscore.js, and I’m having some difficulty understanding some of the conventions. While writing a simpel search filter, I thought that something like below would work: var search_string = new RegExp(query, “i”);var results = _.filter(this, function(data){return search_string.test(data.get(“title”));}));But, in fact, for this to work I need to change my filter function to the following: var search_string = new RegExp(query, “i”);var result
Marcin Pietraszek
javascript underscore.js
Lastly I was skimming through Underscore.js code to learn JavaScript idioms and I found following definition of each function:var each = _.each = _.forEach = function(obj, iterator, context) {if (obj == null) return;if (nativeForEach && obj.forEach === nativeForEach) {obj.forEach(iterator, context);} else if (obj.length === +obj.length) {for (var i = 0, l = obj.length; i < l; i++) {if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;}} else {for (var key
Adrian Salazar
javascript internet-explorer internet-explorer-8 underscore.js
I’m having an issue understanding the mechanics of typeof in IE8.I have the following JavaScript code in “parent.html”:var myNewWindow = window.open(‘child.html’); myNewWindow.sayhi = function() {alert(‘Hi!’); }In parent.html we open a JavaScript console (F12). We test the type and looks correct.typeof myNewWindow.sayhi “function”But if I open a console and do some tests in the child window, the results are somehow weird.typeof this.sayhi “object”The thing is that the “object” c
mikemaccana
javascript underscore.js ecmascript-5
I have an existing project that (sadly) uses underscore.js, rather than an ES5 shim, to support IE8 and other non-ES5 browsers. I’m used to ES5, but don’t generally use underscore. I have read the underscore documentation on _.bind and attempted to get it to work. Here is a working example using native ES5:// Greets people HelloThing = function (greeting) {this.greeting = greeting;this.waitAndSayHello = function() {setTimeout(function() { console.log(this.greeting)}.bind(this), 500);} }var pret
mu is too short
date underscore.js
I wrote a small function to sort data by it date, where date formats are returned by MySQL. https://gist.github.com/cauliturtle/7597913var all_data = _.sortBy(all_data, function(item){var date = new Date(item.created_at);return -Number(date.getTime()); });But it was fail on some deviceswork:desktop chrome android 4.3.2 native browser android chromefail:mobile safari android 4.0 – 4.2 native browser
Alex
javascript regex backbone.js underscore.js mustache
I’m using backbone’s underscore templating engine with the mustache formatting patterns.I have already been successfully using it elsewhere in the project but now for the first time I’m using the looping list patterns from mustache to populate the template which is throwing an error which I’m a bit baffled by. The error in chrome is:”Uncaught SyntaxError: Unexpected token ILLEGAL”and points to underscore’s template function in the backtrace, which is pretty useless but in firebug i get a more he
Wilman Arambillete
javascript backbone.js module requirejs underscore.js
If I am using Require.js for managing modules in a project with Backbone.js (which also has underscore), when extending a module I can do something like thisrequire([‘Home’], function(home) {‘use strict’;var view = home.View.prototype;_.extend(view,{anotherTitle: ‘Welcome Jean Luc Picard’;}); }); orrequire([‘Home’], function(home) {‘use strict’;var view = home.View.prototype;view.anotherTitle= ‘Welcome Jean Luc Picard’; //this is a new attribute}); what is the most approrpiate way to do it
jamie holliday
underscore.js
I’m trying to use handlebars style templating with underscore in backbone (with require.js). I have the following: _.templateSettings.interpolate = /\{\{(.+?)\}\}/g;In my templates I have set up a test:<div><%= title %> | {{ title }}</div>I get the following in the browser:Correct title | {{ title }}So it looks like the standard underscore template settings are working and the handlebars style ones are getting ignored:But if I check in the console in chrome I get this (which lo
Nyxynyx
javascript jquery backbone.js underscore.js
I have a backbone.js/underscore.js template that I am feeding into a backbone view for rendering. The View is passed a model that contains an array posts of objects (which I call post in the template).Problem: When I try to loop through all the elements of the array posts, I get an error Uncaught SyntaxError: Unexpected token ) and refers a line in the backbone View’s code template: _.template( $(‘#tpl_SetView’).html() ). Am I doing the loop incorrectly which is causing this error?Template code&
Web site is in building