I'm trying to setup a backbone application, and I get a "$ is not defined" error.
Tree :
app :/
app.js
js :/
jquery.js
underscore.js
backbone.js
I have a config.coffee file for brunch :
exports.config = paths:
public: 'www' files:
javascripts:
joinTo:
'js/atf.js': /^app/
order:
before: [
'app/js/jquery-2.0.2.min.js',
'app/js/underscore.js',
'app/js/backbone.js'
]
stylesheets:
joinTo:
'css/atf.css': /^app/
templates:
joinTo: 'js/atf.js'
My index.html file :
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="fr"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="fr"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="fr"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="fr" x-manifest="/manifest.appcache"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" type="text/css" media="all" href="/css/atf.css?v=2">
<script src="/socket.io/socket.io.js"></script>
<script src="/js/atf.js?v=3"></script>
<script>require('app');</script>
</head>
<body></body>
</html>
And my app.js file just to make a test :
$(function(){
alert('test');
});
Anyone can help me ? Thanks !
Move files from app/js to vendor (create this directory). And change javascripts.joinTo to the same one you are using in templates.
That should do the trick.
Related
I try to get the ids of all items listed for sale in a collection.
I try to do it with a loop and the the api as explained in the documentation.
The problem is that when I define the contract and the item_id I always get an error that cloudflare blocked me. The problem persists even when I try from a different device and network. At the same time retrieving general asset information works well with other commands of the api.
Am I doing something wrong or is this a problem on opensea?
const options = {method: 'GET', headers: {Accept: 'application/json'}};
fetch('https://api.opensea.io/wyvern/v1/orders?asset_contract_address=0xbd3531da5cf5857e7cfaa92426877b022e612cf8&bundled=false&include_bundled=false&include_invalid=false&token_id=3881&limit=20&offset=0&order_by=created_date&order_direction=desc', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Access denied | api.opensea.io used Cloudflare to restrict access</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/main.css" type="text/css" media="screen,projection" />
For anyone looking it seems to be an opensea issue.
https://github.com/ProjectOpenSea/opensea-js/issues/245
https://twitter.com/apiopensea/status/1461135305193443334
noob question, i start create handlebars templates and is kind useful.
I can create templates without load a html tag in html file, so should I just use handlebars and stop use html tags in my html? what you recommend guys? its a good practice or no? thank you.
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang=""> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<link href='http://fonts.googleapis.com/css?family=Nunito:400,700,300' rel='stylesheet' type='text/css'>
<!-- <link rel="stylesheet" href="public/stylesheets/style.css"> -->
<style>
body {
padding-top: 50px;
padding-bottom: 20px;
}
</style>
</head>
<body class="body">
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please upgrade your browser to improve your experience.</p>
<![endif]-->
<script src="public/javascripts/libs/jquery-2.1.4.min.js"></script>
<script src="public/javascripts/libs/handlebars-v3.0.3.js"></script>
<script src="public/javascripts/index-template.js"></script>
<script src="public/javascripts/templates/h1-h2.js"></script>
</body>
</html>
I'm editing someone elses webpage for content, by changing the HTML files on the drive, adding text, comments, wtv. I'm not a web designer, so this is the only way I knew to do it.
On most browsers, my changes show, but on internet explorer, sometimes it will revert to the old webpage. I can't find the info for the old page anywhere on the drive that holds all of this content. Please steer me in the right direction.
If it helps, each page starts like this (this part I haven't edited)
<!DOCTYPE html>
<!--[if lt IE 7]> <html lang="en-us" class="no-js ie6"> <![endif]-->
<!--[if IE 7]> <html lang="en-us" class="no-js ie7"> <![endif]-->
<!--[if IE 8]> <html lang="en-us" class="no-js ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en-us" class="no-js ie9"> <![endif]-->
<!--[if gt IE 9]><!--> <html lang="en-us" class="no-js"> <!--<![endif] -->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>This Particular Pages Title</title>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="fontawesome/css/font-awesome.min.css" >
<link href="style/less/main.css" rel="stylesheet" type="text/css">
<!-- Custom CSS -->
<link href="css/business-custom.css" rel="stylesheet">
<script src="jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><script src="selectivizr-min.js"></script>
<![endif]-->
I think IE uses caching.
By adding a random parameter to the URL the caching will be circumvented.
so e.g. www.mysite.nl?1
and then
www.mysite.nl?2
etc.
I'm developing a Grails project which is using some JS code. It runs perfectly in Google Chrome (v34.0.1847.116 m) and Mozilla Firefox (v28.0), but it simply does not run/start in IE (v9.0.23). I just have a blank screen.
According to many previous answers on SO community, I should be checking some meta tags which I'm using, but it's not running successfully anyway. There goes my code!
page.gsp, used as main layout:
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html class="win firefox firefox2 gecko gecko2" lang="br">
<!--[endif]-->
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<title><g:layoutTitle default="A nice Title"/></title>
<r:require modules='core'/>
<g:layoutHead />
<r:layoutResources />
</head>
<body>
<div id="container">
<div id="header">bla bla bla<g:navbar /></div>
<g:menu menuKey="1"/> <!-- a taglib which builds a dynamic menu -->
<div id="content">
<g:layoutBody />
</div>
</div>
<div id="footer"><div class="container">bla bla bla</div></div>
<r:layoutResources/>
</body>
</html>
home.gsp, a simple view to be loaded in the layout above.
<html>
<head>
<meta name="layout" content="page" />
</head>
<body>
<h2>A simple content here</h2>
</body>
</html>
I'm loading all my JS and CSS resources using ApplicationResources.groovy but I don't have any JS error according my Firebug. After all, what else could I check or what features/functions' success must I asure?
Change
<!--[if (gt IE 9)|!(IE)]><!-->
<html class="win firefox firefox2 gecko gecko2" lang="br">
<!--[endif]-->
to (properly close the else comment)
<!--[if (gt IE 9)|!(IE)]><!-->
<html class="win firefox firefox2 gecko gecko2" lang="br">
<![endif]-->
I have a strange issue with my work.
While I do test on my local host of my web project while doing page source check i am getting following:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="Scripts/jquery-1.11.0.js"></script>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="/Content/style.css" />
</head>
<body>
Doctype seems to appear twice. But in my actual code it is only
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="/Content/style.css" />
</head>
<body>
Any ideas why could it happen? I have created project in Visual Studio.
Thanks
I had a similar issue which may or may not apply to your case.
In my case, I had index.html which started like this..
<!--#include virtual="/common/incl/html.incl" -->
<head>
In html.incl I defined the doctype amongst other things..
<!doctype html>
<!--[if lt IE 8]><html class="no-js ie lt-ie9 lt-ie8" lang="en" itemscope itemtype="http://schema.org/" xmlns:fb="http://ogp.me/ns/fb#"><![endif]-->
<!--[if IE 8]><html class="no-js ie ie8 lt-ie9" lang="en" itemscope itemtype="http://schema.org/" xmlns:fb="http://ogp.me/ns/fb#"><![endif]-->
<!--[if IE 9]><html class="no-js ie ie9" lang="en" itemscope itemtype="http://schema.org/" xmlns:fb="http://ogp.me/ns/fb#"><![endif]-->
<!--[if gt IE 9]><!--><html class="no-js" lang="en" itemscope itemtype="http://schema.org/" xmlns:fb="http://ogp.me/ns/fb#"><!--<![endif]-->
But when the source was generated it was generating a duplicate doctype appearing after the conditional comments.
When I removed the doctype declaration from the .incl file and instead declared it in the .html file BEFORE the include then it resolved the issue. .html documents are required to start with a document type declaration so since I was not initially defining one in the .html file, but rather in the .incl file, something else in my workflow was adding it for me.