jquery,requirejs,jquery-masonryRelated issues-Collection of common programming errors
gibson
jquery ajax json yql
Suppose I have a YQL query like this (in fact, this is the exact query I’m using):select * from xml where url=”http://blog.artbeads.com/feed/”and itemPath=”//rss/channel/item”Run this query on the YQL Console and it should return 10 items.Now consider the following jQuery (which is nearly the exact code I’m using for production, except for the success call, but I don’t believe that to be an important factor):// Working example at http://jsbin.com/ekomi4 $.ajax({url: ‘http://query.yahooapis.com/v
kumar
javascript jquery jquery-ui
I have this code,I added JS Script file to my Master page.<script src=”/Scripts/Jquery.blockUI.js” type=”text/javascript”></script>This Below code I have in my master page.on document.ready<script type=”text/javascript”>$(document).ready(function () {$.blockUI({ message: $(‘#question’), css: { width: ‘275px’} });}); </script> <div id=”question” style=”display:none; cursor: default”> <h2 class=”padding”><br />An unexpected system error has occurred whil
Teodorescu
php javascript jquery mysql ajax
I have a countdown.In my educational website,the user has two hours to make a laboratory.I want to display PHP dynamically countdown like (02:00:00) after 1 second (01:59:59),etc. I found only JQuery Countdown (with time expiration action) but it doesn’t agree point 2. In every second,I have to update table (ex: time_remaining field) with countdown value. Why this ? There are situations when an user/student solve some equations and the Internet connection is broken or the computer is shutting d
karim79
php jquery html ajax
Trying to load an external php file into another onClick. Iframes will not work as the size of the content changes with collapsible panels. That leaves AJAX. I was given a piece of codeHTML<a href=”#” id=”getData”>Get data</a> <div id=”myContainer”></div> JS$(‘#getData’).click(function(){$.get(‘data.php’, { section: ‘mySection’ }, function(data){$(‘#myContainer’).html(data);}); }); PHP:<?phpif($_GET[‘section’] === ‘mySection’) echo ‘<span style=”font-weigth:bold;”&g
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 ; }));
adeneo
javascript jquery
So I have an ajax form submission system, and I want to prepend the submitted form directly into the HTML when a successful status response is given. Right now I have,$(“.post-submit”).click(function(){var postcontent = $(“.post-form”).val();if (postcontent == “”){return false;}$(“.post-form”).attr(“disabled”, “disabled”);$.ajax({url: “/post”,type: “POST”,dataType: “json”, data: {“post-form”:postcontent},success: function(response, textStatus, jqXHR) {var htmlpost = ‘<div c
Cary Hartline
php jquery forms jquery-mobile
Part of my PHP form is not displaying with jQuery Mobile. The form seems to cut off after <input name=”F_Payment_Preference” type=”hidden” id=”F_Payment_Preference” value=”check”> and then it restarts after </form>. My form seems to function and display correctly without jQuery Mobile. I am not showing the head of the page (it’s in a separate file), but I don’t think that is necessary.”><form action=”<? echo $_SERVER[“PHP_SELF”] ?>” method=”post” name=”form1″ id=”form1″ on
Mohamed Ali
jquery
I use the following function to set my event tracking with google. For this, I takte the breadcrumbs-Text to set the Source Page.I get an ‘unexpected identifier’-errorWhat I want to do isOn the START page, there is no breadcrumb, so the sPage value should be “Source Page Start”. If the user opens an other site, the sPage value should be “Source Page mk-breadcrumbs-text.Thank you, CheersjQuery(function () {var sPages = jQuery(‘.mk-breadcrumbs-inner’).text();var sPage_name = “Source Page “;if (sPa
Tomalak
jquery asp.net-mvc
I have the the following html elements:<tr> <td> <label for=”casenumber”>Case:</label></td><td><%=Html.TextBox(“casenumber”, “”, new Dictionary<string, object>{{“id”, “casenumberID”}})%></td> </tr> <tr><td><label for=”fogbugzUser”>Users:</label></td><td><%=Html.DropDownList(“UserList”, (SelectList)ViewData[“UserList”], new Dictionary<string, object>{{“id”, “userlistid”}})%></td> <
Jeromy French
javascript jquery richtextbox rich-text-editor richtext
I have just replaced CKEditor (which came with a wealth of mysterious problems relating to AJAX updates to the DOM) with the excellent Redactor. We previously used a CKEditor plugin to give us a character count for the rich text editor. How can I achieve the same thing with Redactor? There’s nothing built in and no “plugin” architecture to use.
Freuh
javascript unit-testing backbone.js requirejs jasmine
I have a project loaded using RequireJS and I would like to test the models.I have the following test :require([‘../../js/models/lead_sharing’], function(Lead_sharing_Model) {describe(‘when instantiated’, function () {it(‘should exhibit attributes’, function() {var test = new Lead_sharing_Model({attribute : 3});expect(test.get(‘attribute’)).toEqual(3);});}); });But I have a error ” failed with error: SyntaxError: Unexpected token”…In reality , I don’t know if it’s possible to test a backbone/r
Peter
jquery node.js express d3.js requirejs
I have been struggling with this for a while now but I am not making any progress. I always run into something unexpected.I want to support browser code in node.js (express) that uses require.js, jquery and d3.js to build up a graph (svg), based on http request input parametersThe problem I am having is that once requirejs is initialized it will always return the same jquery and d3.v2 modules and these will all (for each of the client http request) start doing their thing on the same DOM (jsdom)
Ken Kin
javascript requirejs r.js
I am optimizing several js files into one using r.js. It works fine before. Recently,I modified some js code, add the code as:var x = 08;then it shows ERROR:parse error using esprima for file D://webroot/js/a.jsERROR:line 45: Unexpected token ILLEGAL.Line 45 is where I add var x = 08, and 09 will show error too. It seemed that numbers begining with 0 meanwhile containing 8 or 9 is illegal. Maybe they were treated as bese 8 number .. ?How can I let r.js ignore this point and still optimizie js fi
hims056
javascript requirejs
In below code I’m calling myscript.getNum(); but myscript.js throws an error saying Unexpected Token (jloader.jsrequire([“evtManager”,”myscript”] , function(evtManager , myscript) {var el = document.getElementById(“Clickarea”); evtManager.addEvent(el , “click” , function(){myscript.getNum();}); });myscript.js ->loads myscript2.js and calls a function getValue()define([“myscript2”], function(myscript2) {getNum : function(){ //Throws an error “Unexpected token (” var x = require(“mysc
meagar
javascript jquery return requirejs jslint
My application is running requireJS and is set up using two files:main.js sets everything and app.js “runs” the application.main.js looks like this:/*jslint browser: true, indent : 2, nomen : true, sloppy : true */ /*global requirejs: false */ (function () {“use strict”;requirejs.config({baseUrl: “../js”, paths: {app: ‘app’, text: ‘text’…}, shim: {‘overrides’: { deps: [‘jquery’] }…}});// initrequirejs([ ‘overrides’,…, ‘app’], function( $, overrides, …, App){App.start
keithjgrant
requirejs minify web-deployment
I’ve got some paths configured in require-config.js as follows:var require = {baseUrl: ‘/javascript’,paths: {‘jquery’: ‘jquery/jquery-1.8.1.min’// etc. — several paths to vendor files here}, }I am trying to get the optimization working for deployment. The docs say I should have a build.js that looks something like this:({baseUrl: ‘javascript’,paths: {‘jquery’: ‘jquery/jquery-1.8.1.min’},name: ‘main’,out: ‘main-build.js’ })Is there a way to have the optimizer read my config file instead of (or i
gremo
node.js module requirejs amd commonjs
I’m a lot confused about CommonJS, AMD and RequireJS. Even after reading a lot.I know that CommonJS (previously ServerJS) is a group for defining some JavaScript specifications (i.e. modules) when the language is used outside the browser. CommonJS modules specification has some implementation like Node.js or RingoJS, right?What’s the relation between CommonJS, Asynchronous module definition (AMD) and RequireJS? Is RequireJS an implementation of CommonJS module definition? If yes, what’s AMD then
Ahmed Nuaman
coffeescript requirejs gruntjs grunt
I have a project written in CoffeeScript that uses AngularJS. My vendor dependancies are installed using Bower and my file structure is like this:- assets- js- app- model- *.coffee- factory- *.coffee…- app.coffee- config.coffee- routes.cofeee- vendor- angular- lodash…- distWhat I’m trying to do is the following:I’m trying to work out how I can use RequireJS’s r.js to optimise my app files so that I essentially get a concatenated file all ordered nice (so vendor dependancies, my config and ro
madth3
javascript jquery requirejs browser-cache
I’m using RequireJS (the jQuery version) and I want to append GET parameters to my scripts to prevent unwanted caching. I’m using the urlArgs parameter, as suggested in the docs. This is my app-build.js file: ({appDir: “../”,baseUrl: “scripts/”,urlArgs: “cache=v2”,…Then I build the project as follows: $ node ../../r.js -o app.build.jsThe output in app-build directory now contains both require-jquery.js, which is the same file as previously, and require-jquery.js?cache=v2, which is blank.The in
NPehrsson
javascript requirejs
Im thinking of an html5/js mobile app, and I need to store the state of the application. I’m figuring to use RequireJS, and RequireJs does hold the instances and scripts loaded into memory at runtime.Does RequireJs have any hook where I can just ask RequireJs for all stored instances? And also, can I somehow tell RequireJs here are all your stored instances?
Lisa-Marie
jquery-plugins github google-apps-script jquery-masonry google-sites
I am trying to see if I can include JQuery plugin Masonry on a gadget on Google Sites… created from Google App script by using HtmlService to render HTML from a HTML file with:<script src=”http://code.jquery.com/jquery-1.8.2.min.js”></script> <script src=”https://github.com/desandro/masonry/blob/master/jquery.masonry.min.js”></script>However… this only renderes this result: Invalid script or HTML content: https://github.com/desandro/masonry/blob/master/jquery.masonry.
Peter O.
magento jquery-masonry
I am having trouble with masonry and Magento. I am getting a “Uncaught SyntaxError: Unexpected end of input” I cannot seem to figure out how to get rid of this issue. I am also getting a overlapping effect. I cannot figure out if I’m missing CSS or even if my JavaScript is working. I have used no conflict.I would really appreciate help on this, I’m under a bit of pressure to get this sorted now.Here is the URL:http://thecheeky.com/testhomepage
Jack Bonneman
jquery twitter-bootstrap jquery-masonry jquery-isotope
I’m stumbling many hours with the problem below, can someone help me with that please ?This is a little part of my new parallax website:http://bit.ly/1mA3wiqWhen you click on ‘Read more’, the selected blogitem should expand. The other blogitems should be arround it. (Masonry effect) (Isotope)My problemWhen you click the read more button at ‘Blog 1’ all the other blog items go under it… but it should position arround it. Like ‘Blog 2’ and ‘Blog 3’ etc..Does anybody know WHY this happens? I trie
Corey Trombley
jquery jquery-masonry modernizr
Ok so I am trying to use Masonry for the first time and I downloaded a demo from http://www.netmagazine.com/tutorials/get-started-jquery-masonry, the demo works and I followed all the directions. when I try to even just implement it into my own site the animation does not work.errorsGET file://localhost/Users/Lencor/Desktop/ElaineSite/js/modernizr-2.5.3.min.js portfolio.html:26 GET file://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js portfolio.html:26 GET file://localhost/Us
Mike Earley
jquery wordpress methods jquery-masonry
Long story short, I’m attempting to add ‘Masonry’ to my iThemes builder plugin–see this set of instructions. I’m getting uncaught TypeError: Object [object Object] has no method ‘masonry’, after having revised the code a bit to remove ‘imagesLoaded’, which isn’t in masonry anymore I guess? Anyway, I could use some help. Here is my functions.php file for the masonry extension, where the error is occurring. `_base_url = ITFileUtility::get_url_from_file( dirname( __FILE__ ) );// Calling only if no
Craig McDonald
javascript ruby-on-rails-3.1 coffeescript mustache jquery-masonry
I am implementing an endless scrolling effect heavily influenced by this tutorial: http://railscasts.com/episodes/295-sharing-mustache-templates?view=asciicastHowever, I am doing it slightly differently because I am using Jquery Masonry (http://masonry.desandro.com/demos/adding-items.html) on the front end.Anyway, when I implement this as follows:jQuery -> window.endlessScroll = () ->if $(‘#products_page’).length new ProductPagerclass ProductPager constructor: ->$(window).scroll(@chec
TAH
jquery requirejs jquery-masonry
RequireJS newbie here. Trying to convert some JQuery code I had working fine in the old way to work w/ RequireJS.Header of my page loads three JS files via script tags — require.js itself, my require.cfg.js, and boot/main.js with the site-specific functionality.Relevant require.cfg.js excerpt:,paths: {‘boot’: ‘src/boot’,’jquery’: ‘lib/jquery.min’,’jquery.masonry’: ‘lib/plugins/masonry.pkgd.min’,’jquery.imagesloaded’: ‘lib/plugins/imagesloaded.pkgd.min’ },shim: {‘jquery’: {exports: ‘jQuery’},’j
Everett Carney
javascript jquery web jquery-masonry
Web noobie here. I’m having a problem getting Masonry to work properly with the site I’m building. Here is the code I’m trying to execute:$( document ).ready(function() { … var $article_display = $(‘#article_display’);$article_display.imagesLoaded(function() {$article_display.masonry({columnWidth: Math.floor($(‘#article_display’).width() *.3) + 2,itemSelector: ‘.article’,isAnimated: !Modernizr.csstransitions});}); … });I’m getting this error: “Uncaught TypeError: Object [object Object] has n
XuxuBelezA
jquery jquery-masonry
So, I’m using Masonry to make a “fluid” layout in my site but now I’ve encountered a problem involving its hide and reveal methods.In an event, I’m making this call:$container.masonry(‘hide’, $(this));As you can see, I’m using $(this) to tell masonry what element to hide through jqueryBut apparently, this method does not work with a jquery element?The error message in my console looks like this:Uncaught TypeError: Object #<HTMLElement> has no method ‘hide’ (masonry.pkgd.min.js:9)I tried l
Xarcell
jquery jquery-masonry
I’m trying to get masonry working with jQuery using the latest instructions at: http://masonry.desandro.com/options.htmlI have included the js file before the call. The call looks like this:<script type=’text/javascript’>$(document).ready(function() {$(‘#main’).masonry({itemSelector: ‘.post-outer’,isAnimated: true,isFitWidth: true});});</script>It does not work and outputs this error in my Chrome console: Uncaught TypeError: Object [object Object] has no method ‘masonry’Any idea why
Web site is in building