So I want to start using dc.js package to create a few dashboards, and I've found this tutorial:
https://github.com/austinlyons/dcjs-leaflet-untappd
I've downloaded the entire folder and attempted to open the html to see whether it works, but I only get some parts of the page (no data, no graphs, you can see the expected and gotten image attached). I've had the same problem with some other tutorials that I've found, and can't figure out why. I can open the page in the browser when it is a link like:
https://austinlyons.github.io/dcjs-leaflet-untappd/
Any ideas? I am using Chrome btw, but it doesn't work in IE either.
You need to run python -m SimpleHTTPServer in your terminal.
Try it yourself
If you want to play with the code as we go, I recommend downloading
the source code from this GitHub repository, navigating to the
directory where the files are located, and kicking off Python's
SimpleHTTP server so that you can see your visualization in your own
browser at http://localhost:8000 (If this is new for you, see this
link for a bit more information).
If anyone is interested there is a very nice workaround for those not willing to play around with a server. For some reason Firefox allows the opening of such pages, so one can test D3 and similar code in it without having to run a server.
I've got a wordpress site with jquery cookie plugin installed. It used to work fine. For a little while, i've been working with a content that didn't require the plugin. Meanwhile, i've started using cloudflare.
Today, I tried adding content that utilizes that plugin, and suddenly got an error saying "Uncaught TypeError: $.cookie is not a function".
Obviously, the plugin is not loading. What i've done first is, i've moved that plugin from a separate file into header. Right above the script that utilizes it. No luck. I figured, it could still be showing cloudflare cached version, so, i've deleted cache and minified scripts & css. Still no luck. And now I'm stuck.
I know that people here like some code to be provided, but as you can understand, there is a lot of it.
Is it possible that $.cookie is being called before it is loaded? Or that CloudFlare force the loading of a jQuery asset whose version isn't compatible with your cookie plugin?
Looks like disabling cloud flare took a while. Works fine now.
I've deployed my app in production and precompiled the assets pipeline, so my application.js contains everything.
while it was all working fine in development (where files were split) it's not working any more in production, and tooltips and everything don't work any more.
the only problem I'm seeing in chrome console is:
Uncaught TypeError: Cannot read property 'msie' of undefined
it mentions the line containing the error:
jquery.js:9789
although the application.js (precompiled) at line 9789 is blank, and in my source I don't include explicitly any source file called jquery.js, as the jquery is included inside the application.js.
I found that jquery_bbq may be the problem, in I run: grep -r msie * I have only two occurrences:
config/recipes/templates/nginx_configuration.erb
vendor/assets/javascripts/jquery_ba-bbq.min.js
I'm not sure how to troubleshoot this, any ideas ?
thanks in advance
Something you're including is trying to read the msie property of jQuery.browser. But jQuery doesn't have the jQuery.browser symbol any more (it was deprecated in v1.3 and removed in v1.9).
I can't account for the line number other than to mention that jQuery 1.10.2, un-minified, has exactly that many lines. As for the filename, I assume your HTML or something in your application.js or another script you're loading is loading jquery.js. Chrome's Network tab in the dev tools should tell you what's loading jquery.js.
So the solution is to find out what plug-in or similar you're using that's trying to use jQuery.browser.msie (or $.browser.msie) and deal with the fact it's no longer compatible with jQuery. You've already basically done that and found jquery_ba-bbq.min.js
The other thing is to find and deal with whatever's including jquery.js, if you have jQuery baked into your application.js (presumably an older version, if this was working before you combined things).
I'm seeing error messages about a file, min.map, being not found:
GET jQuery's jquery-1.10.2.min.map is triggering a 404 (Not Found)
Screenshot
Where is this coming from?
If Chrome DevTools is reporting a 404 for a .map file (maybe jquery-1.10.2.min.map, jquery.min.map or jquery-2.0.3.min.map, but can happen with anything) first thing to know is this is only requested when using the DevTools.
Your users will not be hitting this 404.
Now you can fix this or disable the sourcemap functionality.
Fix: get the files
Next, it's an easy fix. Head to http://jquery.com/download/ and click the Download the map file link for your version, and you'll want the uncompressed file downloaded as well.
Having the map file in place allows you do debug your minified jQuery via the original sources, which will save a lot of time and frustration if you don't like dealing with variable names like a and c.
More about sourcemaps here: An Introduction to JavaScript Source Maps
Dodge: disable sourcemaps
Instead of getting the files, you can alternatively disable JavaScript source maps completely for now, in your settings. This is a fine choice if you never plan on debugging JavaScript on this page.
Use the cog icon in the bottom right of the DevTools, to open settings, then:
You can remove the 404 by removing the line
//# sourceMappingURL=jquery-1.10.2.min.map
from the top part of your jQuery file.
The top part of the jQuery file will look like this.
/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//# sourceMappingURL=jquery-1.10.2.min.map
*/
Just change that to
/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license */
Purpose of a source map
Basically it's a way to map a combined/minified file back to an unbuilt state. When you build for production, along with minifying and combining your JavaScript files, you generate a source map which holds information about your original files. When you query a certain line and column number in your generated JavaScript you can do a lookup in the source map which returns the original location. Developer tools (currently WebKit nightly builds, Google Chrome, or Firefox 23+) can parse the source map automatically and make it appear as though you're running unminified and uncombined files.
(Read more on this here)
As announced at jQuery 1.11 and 2.1 Released, the source map comment will be removed so the issue will not appear in newer versions of jQuery.
Here is the official announcement:
One of the changes we’ve made in this beta is to remove the sourcemap
comment. Sourcemaps have proven to be a very problematic and puzzling
thing to developers, generating scores of confused questions on forums
like StackOverflow and causing users to think jQuery itself was
broken.
Anyway, if you need to use a source map, it still be available:
We’ll still be generating and distributing sourcemaps, but you will
need to add the appropriate sourcemap comment at the end of the
minified file if the browser does not support manually associating map
files (currently, none do). If you generate your own jQuery file using
the custom build process, the sourcemap comment will be present in the
minified file and the map is generated; you can either leave it in and
use sourcemaps or edit it out and ignore the map file entirely.
Here you can find more details about the changes.
Here you can find confirmation that with the jQuery 1.11.0/2.1.0 Released the source-map comment in the minified file is removed.
Download the map file and the uncompressed version of jQuery.
Put them with the minified version:
Include minified version into your HTML:
Check in Google Chrome:
Read Introduction to JavaScript Source Maps
Get familiar with Debugging JavaScript
The new versions of jQuery require this file http://code.jquery.com/jquery-1.10.2.min.map
The usability of this file is described here http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
Update:
jQuery 1.11.0/2.1.0
// sourceMappingURL comment is not included in the compressed file.
If you want to get source map file different version, you can use this link
http://code.jquery.com/jquery-x.xx.x.min.map
Instead x.xx.x put your version number.
Note: Some links, which you get on this method, may be broken :)
As I understand the browser, Chrome at least, it doesn't disable the source mapping by default. That means your application's users will trigger this source-mapping request by default.
You can remove the source mapping by deleting the //# sourceMappingURL=jquery.min.map from your JavaScript file.
After following the instructions in the other answers, I needed to strip the version from the map file for this to work for me.
Example: Rename
jquery-1.9.1.min.map
to
jquery.min.map
I was presented with the same issue. The cause for me was Grunt concatenating my JavaScript file.
I was using a ;\n as a separator which caused the path to the source map to 404.
So dev tools was looking for jquery.min.map; instead of jquery.min.map.
I know that isn't the answer to the original question, but I am sure there are others out there with a similar Grunt configuration.
jQuery 1.11.0/2.1.0 the // sourceMappingURL comment is not included in the compressed file.
Assuming you've checked the file is actually present on the server, this could also be caused by your web server restricting which file types are served:
In Apache this could be done with with the <FilesMatch> directive or a RewriteRule if you're using mod_rewrite.
In IIS you'd need to look to the Web.config file.
I'm trying to test my app on a new Samsung SmartTV 2013, however when I include google's ga.js locally into my bundle the TV rejects the app and will not install it at all.
The error message provided points to this page: http://www.samsungdforum.com/support/tvappssecurity. Which is pretty vague and unhelpful in this situation.
Any one have a work around for this? I've already looked on the Samsung D Forum.
Thanks!
The TVAppsSecurity is well known error - I have seen it tens of times. It basically says that your code violates Samsung security restrictions. In practice the static source code analysis on TV detects some security flaws.
Note that it is up to you to identify the issue and fix it. Since you know the file that causes the problem - you can easily separate it into test project. Then just start deleting portions of the code until you will be able to install the application. It is annoying, but it will take 60 minutes maximum. Note that sometimes it is even enough to rename the file.
I am not sure if the ga.js hosting is really a problem (see there https://support.google.com/analytics/answer/1032389?hl=en)
You can include ga.js by loading it from external host. In this case it will not be checked during install on TV.