javascript,google-chromeRelated issues-Collection of common programming errors


  • Temere
    javascript html
    I’m making a Javascript slideshow for my blog yet the array doesn’t seem to be working. Can someone please say what I’ve been doing wrong<SCRIPT type=”text/javascript”>var blog = new Array()blog[0]= “<h4>Sunday 17 of June 2012</h4><p title=’Blog’>Donec tempus risus eget ligula viverra eget placerat odio tincidunt. Duis nisl sem, scelerisque faucibus congue vitae, accumsan at lectus. Cras vestibulum arcu ut lorem luctus eu pharetra tortor ultricies. Nam iaculis orci mauris

  • Nick Carfagno
    javascript html
    so here is my code. It is a really simple shipping calculator. when I run it, all that displays is a messagebox asking the purchase price, and then it displays this ” â?< “. Anyone know what is happening?<!DOCTYPE html><html lang=”en”><head><title> Shipping Calculator</title><script > var purchasePrice = window.prompt(“Please enter the price of your purchase to calculate your shipping cost.”);var shippingPrice;function shippingMath(purchasePrice

  • user2964960
    javascript arrays design-patterns syntax
    I am having a issue in adding records to arrays, this is where the problem is:if(score(web[i].content, pattern) > 0){scoresArray.push({“url:” + web[i].url + “, score:” + score(web[i].content, pattern)});}the error report : SyntaxError: Unexpected token +This is the array that this peace of code is reading from:var web = [ {url : “www.lboro.ac.uk”, content : “Loughborough University offers unidegree programmes and world class research.” } , {url : “www.xyz.ac.uk”, content : “An alternative U

  • Raj
    javascript
    I’m trying to create an array of key/value pairs by using the push method, but getting unexpected results.console.log prints this:books: [{“bookTitle”:”Mark Twain”}]Whereas I would expect this:books: [{“Tom Sawyer” : “Mark Twain”}]Here’s the code:var books = []; var bookTitle = “Tom Sawyer”; var author = “Mark Twain”;books.push({bookTitle : author})console.log(“books: %s”, JSON.stringify(books))I’ve tried books.bookTitle = author and books[bookTitle] = author, but the result is the same. Any he

  • Andreu Heineken
    javascript jquery symfony1 jstree
    i did a descendant tree for an entity in my app, using the libray jstree. I do what is usual to use it:show an <ul> & <li> structure as usual then i apply the .jstree(…) function to the parent <div> of the structure.I’m sorry but i can’t provide you my source code because is dynamically generated from diferent parts of the app, but i can show a result example of the <ul>&<li> structure:<div id=”unidadtree”> <ul><li id=182 ><a href=”-ce

  • Dave
    javascript ajax javascript-events
    I have a beginner question. If I make an ajax call using javascript, and then successfully reload the page before the ajax request gets a response, will the response still work?

  • psionicgames
    javascript angularjs anonymous-function
    I am using angularjs and would like to pass an anonymous javascript function from an html element’s ng-click function as a parameter to a function on my scope. I have setup up a simple jsfiddle to demonstrate the problem: http://jsfiddle.net/C4t4LystX/gUj8x/4/. Whenever I try and do this in my code I get this type of error in the console: Syntax Error: Token ‘{‘ is unexpected, expecting [)] Any help or insight on how this can be accomplished would be appreciated.

  • supri
    javascript jquery jsp backbone.js backbone-views
    I am trying to execute jsp code from my backbone view. I am calling server side api from my Html as followsindex.jsp (sample.js is included in this jsp)%@ page contentType=”text/html;charset=UTF-8″import=”foo.*,java.util.List”%> <%Foo foo = new Foo();List<XYZ> xyzList = foo.getList();%>I am using backbone framework. My js code is as below.sample.jsSampleView = Backbone.ModalView.extend({name: “SampleView”,model: SomeModel,templateHtml : “<div ><span>Search </span>

  • user2479024
    php javascript html
    here is what I’m trying to accomplish:I have a file called url.php. When I access this file the only thing that shows up is a url.I wanted to fetch this url and use it as a variable on a iframe in a different page.Here is what I got:<?php $myvar = file_get_contents(‘http://localhost/url.php’); echo “<iframe src=’$myvar’ height=”1800px” width=”1900px” frameborder=”0″></iframe>”; ?>But it doesnt seem to be working.Parse error: syntax error, unexpected T_LNUMBER, expectingAny sugg

  • Anthony Forloney
    javascript regex
    Greetings JavaScript and regular expression gurus,I want to return all matches in an input string that are 6-digit hexadecimal numbers with any amount of white space in between. For example, “333333 e1e1e1 f4f435” should return an array:array[0] = 333333 array[1] = e1e1e1 array[2] = f4f435Here is what I have, but it isn’t quite right– I’m not clear how to get the optional white space in there, and I’m only getting one match.colorValuesArray = colorValues.match(/[0-9A-Fa-f]{6}/);Thanks for

  • Gerard Westerhof
    javascript jquery google-chrome
    I initiated a JavaScript/jQuery click listener like this:$(“#test”).on(“click”, () => {console.log(“test”); });This piece of code works perfectly fine in Firefox but in Chrome this seems to give me a Syntax error. Why is this, since this looks like ‘ok’ syntax to me.You can test this quickly in the console by doingvar a = () => {return 0;}a();In Firefox 27.0.1 this returns 0 In Chrome it returns SyntaxError: Unexpected token )

  • user1003620
    javascript html google-chrome
    I’m new to web programming so it is quite possible that the problem here is embarrassingly obvious, but…Chromes DevTools is giving me two errors for this code. An Unexpected-end-of-input and an Undefined-function error. These both sound to me like they are being caused by a syntax error, but I can’t find it if it’s there. Can anyone see a syntax error? Or is there something else I’ve done wrong?<!DOCTYPE html> <html> <body><p1 id=’txt’></p1> <button onclick=’ma

  • Blender
    javascript google-chrome safari syntax-error
    Both Chrome and Safari report this is illegal. They report “unexpected token ‘this'” pointing at the ‘this.b’. Here is the minimum code needed to show the problem:function x(){ this.a = function() {} this.b = function() {} }It only happens if the two declarations are on the same line. Any ideas? Looks legal to me. It’s annoying because this is what comes out of a Javascript minifier.

  • Nikolay
    google-chrome websocket
    I am using Chrome 16. Since yeasterday i had no problems with opening websockets but something happened and now when i try to open websocket at websockets.org I receive this message – “Unexpected response code: 200” – at the console.I tried to uninstall it several times and change versions (Chrome 14) with no result. How can e repair my browser? PS: I read that status 200 means OK for opening a websocket but the socket is disconnected.

  • Jeff Atwood
    servlets google-chrome html5-video google-chrome-frame
    I use HTML5 video tag, back-end is on Java. It works fine in Firefox but in Chrome it sends more than one requests to servlet and finally there is Exception in servlet and it doesn’t work.I’ve read that firstly to make element in DOM and then assign src to it, but still it sends more than one requests.Do you have any solutions for me?

  • Andreas_D
    html google-chrome safari span
    The following snippet runs fine in FF/IE (nothing is displayed) but in chrome/safari, the 1st span is displayed!<p><span style = “display:none”><div>inner</div></span><span style = “display:none”><div>inner</div></span> </p>Anyone with an explanation?

  • Doorknob
    javascript regex google-chrome
    I realized that I couldn’t match an empty regex with /(regex here)/ syntax, because // is a comment.’this is a test’.match(//) > SyntaxError: Unexpected token }So, I tried new RegExp(”) and it worked:’this is a test’.match(new RegExp(”)) > [“”]But when I checked the output of new RegExp(”), it was this:new RegExp(”) > /(?:)/Why is this? (I am using Chrome version 26.0.1410.64 (Official Build 193017) m and this is in the JavaScript console)

  • José Luis
    javascript json google-chrome
    var origtext = Aes.Ctr.decrypt(recentPatientsFile.read().text, ‘L0ck it up saf3’, 256); var recentPatientsList = JSON.parse(origtext);while doing an alert(origtext), i get empty data. The JSON.parse(empty data) works fine in other browsers, but in google chrome i get Uncaught SyntaxError: Unexpected end of input . When i remove the JSON.parse(), then everything seems to be fine.

  • Ronny
    google-chrome google-chrome-app
    The official documentation here doesn’t mention that, but it looks like support for setting width & height for launch flow windows has been added – See the issue.So I tried this from a packaged app on Chrome 29 (stable) and 31 (canary):chrome.identity.launchWebAuthFlow({url: MY_FACEBOOK_OAUTH_URL,interactive: true,width: 400,height: 300 }, function(){});And got this: Error: Invalid value for argument 1. Property ‘width’: Unexpected property, Property ‘height’: Unexpected property.Anyone know

  • Devesh Agrawal
    jquery html internet-explorer google-chrome firefox
    I have some code here. That is working fine in Chrome, but not in IE and Firefox.$(document).ready(function(){$(“.thumb”).click(function(){alert (“Reached here.”);var cat_id = $(this).attr(‘id’); // get category idalert (cat_id);}); });<a href=”#” class=”thumb” id = “20” name=”df” ><img src=”images/dry_fruits.png” alt=”Title #0″ width=”75″ height=”75″/> </a>Its even not hitting the alert in Firefox and IE. Can someone please help me to identify the issue. Any help will be highl

Web site is in building