javascript,jquery,css,scrolling,positioningRelated 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

  • 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.

  • Love Senya
    css less lessphp
    I’m try to compile this .less code to .css via lessphp and get this error:Fatal Error: ==================== infinite loop detected: @pos-x: failed at `background-position: @pos-x 0; }` line: 3Here is my code.@pos-x : 0; @w : 30px; .a { background-position: @pos-x 0; }@pos-x: @pos-x – @w; .b { background-position: @pos-x 0; }What’s wrong with it? Can i use varable overriding in LESS?

  • 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??

  • vals
    css
    background: url(“images/main_bg.png”) repeat;Is a header/banner background image in style.css, but not sure how to get a shadow around it…I tried body {font-family: Arial,Helvetica,sans-serif; font-size: 13px;color: #333333;background: url(“images/main_bg.png”) repeat;box-shadow: 0 0 5px 2px #282a2d;line-height: 1.4; }But that didn’t work out…

  • thealexbaron
    jquery css
    Click “Rate” – that should pop up a normal boxy dialog, but styles aren’t working. Any ideas?Here’s the working example on the site: http://www.great-quotes.com/boxyTest.htmThe official boxy docs: onehackoranother.com/projects/jquery/boxy/.boxy-wrapper { position: absolute; } .boxy-wrapper.fixed { position: fixed; }/* Modal */.boxy-modal-blackout { position: absolute; background-color: black; left: 0; top: 0; }/* Border */.boxy-wrapper { empty-cells: show; }.boxy-wrapper .top-left,.boxy-wrapper

  • BoltClock
    css background-image
    Is anyone aware of a way to change one layer of a multi-layered background using pure css? I’ve been searching around but can’t find any mention of current, or even proposed future specification. My thinking says there probably wont be, but the net is so vast now I’m sure someone, somewhere, has information or links to discussions along these lines.pseudo cssAn example way of implementation, just to illustrate what I mean. The following would obviously have problems with regard to the order of p

  • ?s??o?
    android html css forms
    I have a mobile web app that displays a dialog box within a position: fixed element overlaying the entire screen. No matter how much content is displayed or how far the page has scrolled, the overlay element dims the page content and the dialog appears on top of it all. There is an <input type=”search /> field in the dialog.On Android, when the user taps the input field to give it focus, some pretty erratic behavior often (but not always) ensues:The soft keyboard appears, then immediatel

  • Sander Marechal
    html css
    I need some help with my design. I want to display three equal-height boxes next to each other, like this ASCI art:+——+ +——+ +——+ | | | | | | | | | | | | | | | | | | +——+ +——+ +——+I also have an example online (with all the CSS).The contents of the boxes varies in height. The tricky thing is that these boxes also need to have rounded corners. For that I am using the “sliding doors” technique. Basically, the markup of a box is s

  • m1crdy
    jquery css jquery-mobile iscroll iscrollview
    i got iScrollView in my app for native scrolling but I´m getting a strange behaviour. The content is bouncing and then jumps down or up and stays there. I´m getting the feeling, that the plugin isn´t calculating the height… Anyone got this problem, too?My HTML<!DOCTYPE html> <html><head>// scripts are included </head><body><!– START PAGE –><div data-role=”page” id=”reviews”><!– START HEADER –><div data-role=”header” class=”header” data-pos

  • Troels Larsen
    jquery html css css3
    I’ve been exposed to the commandment of ‘no tables for layouts’ for years now, but I’m wondering if CSS still has no easy (readable) way of doing grid layouts?It’s been ages since I last did web development, and coming back to it from WPF, CSS still seems like a very limited way of coding layouts.What I’m trying to achieve is show in the Basically, I want my form to contain 5 columns:1 holding s. Autosized after the widest element 4 taking up the remaining space in the parent container, divided

  • grammar
    html css flex json rollovers
    I am using JSON to parse HTML data with customized html tags in Flex. Flex’s support for HTML is pretty minimal, so I am wondering if it’s possible to do a simple font color change rollover effect on these links. Currently I have found that Flex only supports a few HTML tags, but also supports CSS through Flex’s whack CSS methods. Can I manipulate HTML that is written in my JSON files through an external CSS file? Or better still using a simple tag with the JSON file?

  • Mot
    java windows scrolling swt
    We are in the process of converting a Swing application to SWT and it’s already usable. What drives me really nuts is that with SWT (in contrast to Swing) on Windows only the focused control (e.g. table, list, multi-line text field) is scrolled, even when the mouse cursor is over another control.Is there a possibility to change this behavior in our application (not having to install a third-party utility), e.g. by installing some control-independent hook/filter for scroll events which either red

  • Steven
    html scrolling
    I have the following div and the native scrolling does not work on it. Is there anything from this code that could possible be caused the scrolling to fail? Or is there something I can add to this to make the scrolling work?<div id=’calvw’ style=’overflow= hidden;’> <a id=’calevvw’ dhx_l_id=’#id#’ data-ajax=’false’ href=’eventview.php?eventid=#id#’ class=’dhx_list_item dhx_list_day_events_time’style=’width:{common.widthSize()}; height:{common.heightSize()}; border-bottom: 1px solid

  • Gabriel
    html css scrolling alignment
    In an HTML page, if I align some <div>s with “right: 0px”, they all look very nice, as I expect. However, if I make the browser window smaller and the horizontal scroll bar appears, when I scroll the page to the right, I see an unexpected white space (instead of the background colors of my <div>s). It seems that my <div>s are aligned relative to the visible area of the page. See the sample code below:<html><head><style><!–#parent {position: absolute;left:

  • Nips
    javascript ipad scrolling kendo-ui rubber-band
    I have a web application running on iPad. This application contains a Kendo UI Accordion inside it. When the content of the page is more than the size of the screen and when I want to scroll, normal page scrolling happens (as expected). But when try to scroll the Kendo Accordion, the page scrolling happens instead of accordion scrolling (unexpected). I was able partly handle this issue by applying solution given by Chris Barr. After applying this solution the accordion is getting scrolled instea

  • user2696615
    android webview scrolling android-4.4
    I am seeing some unexpected behavior when using a WebView in Android 4.4 (build target 18). One one page in particular we have some edit text fields, and to get the soft keyboard to pop up appropriately, we had to use a code snippet similar to the ones described here: https://code.google.com/p/android/issues/detail?id=7189webview.setOnTouchListener(new View.OnTouchListener() {@Overridepublic boolean onTouch(View v, MotionEvent event) {switch (event.getAction()) {case MotionEvent.ACTION_DOWN:cas

  • LukeS
    javascript jquery html scrolling mobile-browser
    I am trying to scroll to a specific location in a scrolling DIV. Right now I am using a pixel offset with the jQuery scrollTop() function which works great on desktop browsers but it does not work on android mobiles browsers with the exception of Google’s Chrome Android browser (do not have an iOS device to test if that works). All the solutions I have found are for page (window) scrolling and not for scrolling in a DIV, anyone have any suggestions on what else I can use to accomplish the same

  • Karl Taylor
    iphone objective-c uiwebview scrolling uiscrollview
    Hi does anybody know how I can programatically scroll a UIWebView in Objective-C (iPhone SDK)?The only solution I can think of is to put it inside a UIScrollView and programatically scroll that, however this presents the problem that the web view is often the wrong size and therefore the bottom of the page is cut off when scrolling. I have no idea how to programatically change the size of a web view to fit its content either… so far I have:UIView *webDocView = webView.subviews.lastObject;webVi

  • Peter Craig
    javascript scrolling
    I have a very wide website, intentionally designed to have no vertical scrolling but a lot of horizontal.Scrolling horizontally is usually a pain to users so was wondering if there was some way of using the middle mouse or other scrolling habits (eg. page up/down, up/down arrows, middle mouse click/drag) to scroll horizontally instead of vertically.Edit: The main reason for requiring horizontal scrolling is because the layout/approach is a left to right graphical/interactive timeline. I’ve since

  • jepo
    android graphics scrolling system real-time
    I am currently writing an app that should display a real time measurement curve in a scrolling fashion (think ECG recorder or oscilloscope). An unexpected system call in the UI-Thread makes the display stutter.The data rolls in via bluetooth. All works fine and the display is reasonably smoothly scrolling with an average update rate of 26 frames/s. But, nevertheless the display is stuttering remarkably.I used traceview to get more insight and according to traceview the stuttering is the result o

  • Joe
    linux vim freeze scrolling
    My Vim keeps flashing and freezing (not sure if right word to use) whenever I scroll out of bounds (go too far on ANYTHING). Ex: If I’m on line 1 and try to move up / on the last line and try to move down (this one ESPECIALLY, I use mouse wheel to scroll often so this gets REALLY annoying very quickly) If I go into command mode and then try to press tab to use autocomplete on file/commands that don’t existand so on. Here is my vimrc.1 set vb2 3 ” incremental search4 set incsearch5 set ignorecas

  • beaudrykock
    ios uiscrollview positioning
    I have a UIScrollView added and positioned via Interface Builder, as part of a view controller on a navigation controller stack. When I push a new view controller onto the stack, then pop that new view controller, the UIScrollView in the original view has drifted upwards by exactly 52 pixels. This ONLY happens on the device, and not the Simulator.Any ideas what might be causing this? I can fix it retroactively with calls to re-position in the viewWillAppear/viewWillAppear, but for some reason on

  • lockstep
    spacing floats positioning
    I’m using a two column environment, and I placed a table in the left column, as shown in the image:Below it the latex source excerpt used to draw such a table:\documentclass[final,5p,times,twocolumn]{elsarticle}\usepackage[table]{xcolor} \usepackage{booktabs}\begin{document}Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus quis metus a massa fringilla rutrum. Nulla in tincidunt eros. Maecenas porta facilisis pretium. Ut id tortor ac libero mattis aliquet. Fusce tincidunt, orci u

  • lockstep
    floats positioning longtable
    I am writing a document describing a process step by step. After trying with enumerate (which did not look so appealing) I switched to longtable. This longtable can span more than two full pages.The problem I ran into is illustrated by the MWE below. Since there is not sufficient space on the first page to place the figure, it is moved after the longtable. Is there a way of placing floats so they interrupt the longtable? The figure should be on the top of page 2.Or is there a different LaTeX mac

  • DevSolar
    positioning mdframed supertabular
    Finding that a certain table in my document had to span several pages, and that longtable doesn’t fit the bill because I have to change the running header mid-table, I turned to supertabular.To get the vertical spacing right I use booktabs.Since that broke the vertical lines surrounding the table, I thought about working around that by wrapping the whole table in mdframed.So far about the history why anyone would want to wrap a supertabular with mdframed in the first place. ;-)Now to the issue a

  • animuson
    html css positioning css-position
    Please consider this jsfiddle, containing this html code:<div id=”container”><div id=”item”>TEST</div> </div>And some CSS:#container {border: 1px solid red;height: 100px;width: 100px; }#item {border: 1px dashed purple;position: absolute;left: 50%; }The results surprise me. Looking at the W3 positioning props I’d expect the #item to have its left value at 50% of the “containing block”: the #container. However, it seems to be at 50% of the entire page, not just the containi

  • Sprottenwels
    css layout css-float positioning
    Fiddlehttp://jsfiddle.net/cZH7F/1/Why does .sample-section’s border affect this large area that includes floated elements enclosed in a previous element?Edit (Solution):So, for future visitors, i will summarize what i learned here todayWhite spaces in your HTML can elements cause to behave unexpected:With whitespaces Without themCSS property display: inline-block can be an alternative for floatinline-block Float (works with whitespaces, for some reason)

  • odiseh
    c# winforms ide controls positioning
    C#: How can I move my controls on a win form in windows application freely? I do NOT want IDE control the position of my controls for me.Thank you

  • yoshi
    jquery jquery-ui positioning
    I want to fall in love with jQuery UI’s positioning feature but everytime I run the attached code I get the following errors in javascript’s console: firefox: (b[this] || “”).split is not a functionchromium: Uncaught TypeError: Object [object Object] has no method ‘split’ I’ve downloaded the full jquery-UI package and included the css, jQuery-min and jQuery-UI-min.Not sure if I’m just using it wrong and missing a simple thing to kick of the magic. I tried to mimic the example from the project

  • xralf
    javascript css positioning onscroll
    I have a CSS layout as in the attached picture.I’d like to achieve the following behaviourWhen part of the header is visible the positions (when scrolling) are as in the picture. When header is invisible (we’re scrolling down more then header length), the positions of left, right and img should be fixed and the only scrollable part should be page content.So far fiddle linkLiam suggested this link but javascript has error Uncaught TypeError: Property ‘$’ of object [object DOMWindow] is not a func

  • user667193
    css list positioning html-lists
    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml” xmlns:fb=”http://www.facebook.com/2008/fbml”> <head> <title>My Videos</title> <script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js”></script> <script type=”text/javascript” src=”http://code.jquery.com/jquery-1.4.4.min.js”></script> &l

Web site is in building