javascript,jquery-plugins,jqgridRelated issues-Collection of common programming errors
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=’
adambender
javascript best-practice
I come from a Java background so my desire for proper unambiguous logging is strong. I prefer using the console to using some other gui widget however, in the browser I know that I can’t always count on the console to exist or for it to have all the levels I might like. To remedy this I worked up the following console sanitizer and I was curious what drawbacks it might have.function configureConsoleLog() {“use strict”;var logMethods = [ ‘trace’, ‘debug’, ‘log’, ‘info’, ‘warn’, ‘error’ ], i;if (!
palacsint
javascript php google html5
I am newbie at JavaScript, I am using PHP to get data from a MySQL database, and use the data to drop multiple markers into google map. Please give me some suggestion to my code, really appreciate for any your advice.<?php require_once ‘Common/system_start.php’; $sql=”select * from tab_mem order by sn desc “; $result= mysql_query($sql); $data=mysql_fetch_assoc($result); $row=mysql_num_rows($result);header(“Content-type: text/xml”);// Iterate through the rows, adding XML nodes for eachwhile (
Brandon Wamboldt
javascript node.js
I’m looking for some general feedback about the layout and structure of my code. Basically just any feedback, as I’m not super happy about this code, but I’m not sure how to improve it further.’use strict’;/* jshint node: true */var fs = require(‘fs’); var os = require(‘os’); var nodemailer = require(‘nodemailer’); var rimraf = require(‘rimraf’); var config = require(‘../config’); var dropbox = require(‘../lib/dropbox-sync’); var mysql = require(‘../lib/mysql-back
user2456359
php javascript wordpress
I’m struggling with adding the jQuery to the templated I transfered to WordPress, From what I’ve already learned from WordPress you need to use WordPress functions to include js files, is that always neccasary? Could somebody please take a look at the function I’ve written?header.php<!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta http-equiv=”Content-Type” content=”<?php bloginfo(‘HTML_type’);?>” charset=”<?php bloginfo( ‘charset’ ); ?>”
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
Sean
javascript node.js gruntjs livereload
PC Specs: Windows 7 Enterprise x64I’m running grunt.js on a project and recently started receiving an error when attempting to run ‘grunt watch’.Grunt worked fine yesterday but today I started seeing:Running “watch” task Waiting…Fatal error: listen EACCESI read another question here: Cloud 9 and Grunt.jsthat lead me to remove ‘options: {livereload: true}’ from Gruntfile.jsrunning watch again works as intended. Is there a way to reconfigure grunt or livereload to get livereload working with G
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
Septagram
javascript fatal-error
Is it possible to terminate script on a certain condition with a specific error message? Exceptions are not an option, as they can be catched, thus avoiding termination.Update:I’d prefer the universal approach, but if there’s none, then it’s for the in-browser JavaScript. Error should be silent, and the error message should only go into the browser error log.
Ates Goral
javascript gruntjs
I removed the old grunt first,and I install the new grunt.But I got an error:D:\www\grunt-test\grunt grunt-cli: The grunt command line interface. (v0.1.4)Fatal error: Unable to find local grunt.If you’re seeing this message, either a Gruntfile wasn’t found or grunt hasn’t been installed locally to your project. For more information about installing and configuring grunt, please see the Getting Started guide: http://gruntjs.com/getting-startedIs there haven’t a grunt in my system path, or somethi
robx
jquery jquery-plugins jquery-ajax jquery-validate
I am getting very frustrated with this jquery form validation ajaxSubmit();In chrome, it seems to fail silently without even hitting the submitHandler, firefox does, but still goes on to the action=”contact.php” page. I was expecting it to just post in the background and possibly return results, but can’t get it to work that way.Edit: Found a fix for this if anyone else is interested, put this line of code somewhere in your dom ready. // disable HTML5 native validation and let jquery handle it.$
Basem
javascript jquery jquery-plugins mvvm kendo-ui
I extended the multiselect widget with nothing special. The issue is the binding of values no longer work. In a first sample, I’m using the native widget and binds values fine. The second is where I use an extended multiselect which fails on the value binding and is blank.HTML:<selectdata-role=”multiselect”data-bind=”source: selectData, value: selectedIDs”data-text-field=”Name”data-value-field=”ID”></select> <selectdata-role=”multiselectcustom”data-bind=”source: selectData, value:
Jørgen
c# jquery jquery-plugins tdd webdriver
Select boxes, checkboxes and radiobuttons are difficult to style with CSS, so it is common to apply plugins, replacing the native form elements with regular elements that are easier to apply CSS to.The jQuery UI Selectmenu is an example: http://filamentgroup.com/lab/jquery_ui_selectmenu_an_aria_accessible_plugin_for_styling_a_html_select/These plugins typically produce markup like this:<select name=”mySelect” style=”display: none; “> <option value=”1”>1</option><option value
Kara
internet-explorer jquery-plugins navigation hashtag
I have a website that uses the jQuery Address plugin from Asual for navigation.The problem I am having, is that using IE6, and IE7, when the user uses the back/forward buttons the website ends up at an unexpected page.Here’s a cut-down version of what I’m doing right now.$.address.init(function(event) {defaultPage = “1”; }).change(function(event) {$(“#content”).html(‘<div><img src=”/images/activity indicator.gif”></div>’)$(“#content”).load(“./pages/”+names+”.html”, function(){v
Erwin
jquery jquery-plugins append
Using jQuery’s plugin architecture, I have in my js file a line of code that appends a simple “div” element to a textbox. The task seems so simple, but I can’t figure out where I’m going wrong.A snippet from my html file<div style=”margin-top:50px”>Search: <input id=”searchbox” type=”text” /><br /> </div> … <script type=”text/javascript”> $(document).ready(function() {$(‘#searchbox’).testplugin(); }) </script>This is from the testplugin.js fileinit : functio
user837032
javascript jquery codeigniter jquery-plugins jquery-ajax
What is the reason for this error? How do I fix? error with Google Chrome :An error has occured: [object Object] parsererror SyntaxError:Unexpected token ILLEGALerror with opera:An error has occured: [object Object] parsererror SyntaxError:JSON.parse: Unable to parse value:error with ie9:An error has occured: [object Object] parsererror SyntaxError:Invalid characterand …js code:$(‘#hotel’).keypress(function () {var dataObj = $(this).closest(‘form’).serializeArray();$.ajax({url: ‘http://l
Marco
javascript jquery image jquery-plugins resize
Looks like I haven’t explained myself well. I do apologize for that.I have edited this question to make it more clear.The scenarioWe have a website that doesn’t host the images. What it does is a reference to an image in other server.The planResize images keeping proportions. Center resized images. Flexible so it can fit in several sizes.The bugMy code works as intended, however there is a Bug that only happens sometimes.If you go to the search page of the website, and swap between page 1, 2, 3
Jackie
jquery jquery-plugins
I wrote a jQuery plugin to control animations for several images on the same page. The calls are initialized at the beginning as:$(“#image1”).anims({top: “240px”, left: “300px”});$(“#image2”).anims({top: “160px”, left: “430px”});The anims plugin basically applies a bunch of animations on mouseover and mouseout (using hover) based on the top and left parameters supplied. However, once everything is loaded in Safari, mousing over #image2 causes #image1 to animate with the parameters set for #image
thelolcat
jquery oop jquery-plugins data jquery-data
I noticed a lot of jQuery plugin developers use the $.data function to store the state of some type of action.$.data(this, ‘playing’, true);instead of just assigning a property to the plugin object instance:this.playing = true;What’s the deal here? Are there some benefits on using $.data ?
Mpampirina
jquery-plugins google-chrome dialog scrollbar nyromodal
I seem to have stuck numerous hours in a modal dialog with unexpected behavior in Chrome, for which I could use your help. The dialog is a hidden div consisting of two smaller divs, one floated left and one floated right.I use nyroModal for my dialog and have tried different workarounds to hide scrollbars, like using overflow: hidden, or trying to set the sizes of the dialog manually (though I find it kind of hard to customize nyroModal, due to my limited knowledge yet in JavaScript). The basic
WildBill
jquery jqgrid
I know how to use the search feature on JQGrid where you send the request back to the server each time a filter or search is performed. Doing so if you code the php correctly you can perform a LIKE search on the data in the column. For example, if a column contains the string Hello World and you search on world you will get a match. Yet if you use the loadonce option with jqGrid not only will world fail to return a match but hello will as well.Is there a way to do this natively with the loado
Oleg
jquery jqgrid jsonp geojson jsonreader
I’m trying to read and post in a jqGrid a set of earthquakes GeoJSON data extracted from USGS repository. The request is accepted, but displays “Uncaught SyntaxError: Unexpected token” when probably meets the header metadata.$(function () {‘use strict’;$.extend($.jgrid.search, {multipleSearch: true, multipleGroup: true, overlay: 0});$(‘#grid’).jqGrid({url: ‘http://earthquake.usgs.gov/earthquakes/feed/geojson/2.5/week?callback=?’,datatype: ‘json’,colModel: [{name: ‘mag’, label: ‘MAGNITUDO’, width
iabbott
c# linq jqgrid
Preparing data for jqGrid I get an unexpected array of cells for the subgrid. The simplified code looks like:var result = new {total = 1,page = 1,records = qstList.Count(),rows = qstList.Select(( c, i ) => new{Id = c.QuestionId,Text = c.Text,Type = c.Type,Points = c.Points,Ordinal = c.Ordinal,subgrid = new{subtotal = 1,subpage = 1,cell = qstList.Where(q => q.QuestionId == c.QuestionId).Select(q => q.Answers).Select((d, j) => new{Id = d.Select(a => a.AnswerId),Text = d.Select(a =&
Alicia
jquery asp.net-mvc-4 jqgrid
JQGrid is not displaying an error in the form when submitting incorrect data. It works on my local machine but not in production. It used to work in prod but I’ve made a couple of changes in the last couple of months and am not sure which change broke it. I am using JQGrid 4.4.1, jquery 1.7.2 and MVC 4. The error in the browser is showing the followingUncaught SyntaxError: Unexpected token < jquery%20-1.7.2.min.js:3 e.extend.parseJSON jquery%20-1.7.2.min.js:3 editItems.errorTextFormat WaterRe
Fung
json jqgrid
I am getting a JSON.parse: unexpected character exception while I am trying to read a local JSON in my JQGrid. <script type=”text/javascript”>var jsondata = { “totalpages”: “1”, “currpage”: “1”,”totalrecords”: “2”,”invdata” : [{“name”:”New York City”, “country”:”USA”, “continent”:”NorthAmerica”},{“name”:”Paris”, “country”:”France”, “continent”:”Europe”}]};$(document).ready(function() { $(“#grid”).jqGrid({ data: jsondata,datatype: “json”,colNames: [“Name”, “Country”, “Continent”],colModel:
user2067567
jquery jqgrid
Am working on JQGrid and i got this doubt on how to implement.Currently am displaying standard set of results to user every time as given in examples.colNames:[‘Inv No no NO’,’Date’, ‘Client’, ‘Total in EUR’]Suppose if am changing this result set i will change in .js file (add or remove column) of JqGrid.Is there a any way i can bring these Column names from Table and Bind it to JqGrid ?Also how do i ADDcolumn names at runtime ? like adding new Column and all.Thanks
Peter Mortensen
javascript jquery css jquery-ui jqgrid
I want to change the CSS of the add form of the jqGrid. Are there any methods available for changing the complete CSS in the linking of the add form for the jqGrid?I want to import another CSS file for the add form and apply for that add form.
user398247
jqgrid jqgrid-asp.net
I’ve tried with limited success to get dynamic columns to work with jqGrid. Limited in that I can control the column names and formatting from the controller. But when I do this I can’t get the data in.Do you have a small sample solution that shows the controller code for the two calls.
user1624552
javascript jquery asp.net-mvc-4 jqgrid
I am using jqGrid in my asp.net mvc4 project and in one of my view I have the following:<table id=”_componentGrid” cellpadding=”0″ cellspacing=”0″> </table> <div id=”_componentPager” style=”text-align: center;”> </div>and I have a javascript file that begins like this:function showGrid() {$(‘#_componentGrid’).jqGrid({caption: paramFromView.Caption,….in runtime an error is generated:The object does not accept the property or method ‘jqGrid’.How to solve this?
Andrus
asp.net-mvc jqgrid toolbar
How to change jqgrid button tooltip texts at runtime? The following code in Site.Master does not change them, static tooltip texts tooltips are still read only from grid.locale-xx.js file. How to change them in Site.Master ?<script type=”text/javascript”>$.jgrid.no_legacy_api = true;jQuery.extend(jQuery.jgrid.defaults, {addtitle: ‘Add new row new tooltip’, deltitle: ‘delete button new tooltio’, edittitle: ‘<%= Res.I(“Muuda rida”)+” (F4)” %>’, });
Web site is in building