I am using Google +1 on my games website. It's very difficult for me to validate the page. I tried near about every solutions on stackoverflow but always disappointed :-(
Please help me to solve the problem.
Here is the code I'm using,
<div class="gbutton" ><g:plusone size="medium"></g:plusone></div>
Thank you!
For w3c validation please use the code like,
<script language="javascript" type="text/javascript">
//<![CDATA[
document.write('<g:plusone size="medium" href=""></g:plusone>');
//]]>
</script>
Apparently this guy has an answer:
http://jamesingham.me/blog/google-plusone-w3c-valid
Even though it's not strictly "valid."
Well, I found a solution which validates the page successfully.
<div class="g-plusone"></div>
But drawback is we can't use size="medium".
Related
Simple example - two templates:
<script type="text/x-jsrender" id="tpl-test1">
<div>{{include tmpl="tpl-test2" /}}</div>
</script>
<script type="text/x-jsrender" id="tpl-test2">
<div>Hello World</div>
</script>
If I render tpl-test1, it displays "tpl-test2" in the browser instead of Hello World. If I render tpl-test2, it renders Hello World just fine.
What gives?
Boris, himself, answered my question. The {{include}} needs to specify a selector.
{{include tmpl="#tpl-test2" /}}
Thought I'd post this in case anyone else experiences a similar brain fart. ;-)
In this fiddle, the tool tips are not working. Does anyone know why?
http://jsfiddle.net/yDk6z/1/
nv.models.scatterPlusLineChart();
...
Please include the following JS in your project.
http://cdnjs.cloudflare.com/ajax/libs/d3/3.2.2/d3.v3.min.js
<h2>Promises not kept NOTHING CHNAGED HERE</h2>
<div id="chart" class="with-3d-shadow with-transitions">
<svg></svg>
</div>
DEMO LINK
I wanted to show an animated gif while the LinkedIn Member Profile Plugin is being loaded.
Here is the original code:
<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/MemberProfile" data-id="http://www.linkedin.com/in/reidhoffman"
data-format="inline"></script>
I found a similar question here but I'm not sure how I can apply that to the LinkedIn script.
Any solutions would be appreciated :)
I managed to figure something using related examples but the gif gets removed few seconds before the script is actually displayed.
I placed the linkedin plugin codes in linkedin.js and tried both below methods:
1:
$('#linkedin').html('<img src="ajax-loader.gif" />').load("linkedin.js");
2:
$('#linkedin').append('<img id="animation" src="ajax-loader.gif" />')
.load("linkedin.js")
.complete(function(data) { $('#animation').remove(); });
HTML
<div id="linkedin"></div>
I suppose the gif is removed once the script is loaded and yet to be executed? I also tried using getScript() couldn't get any results.
simple question: How do I execute inline javascript in a HTML page snippet loaded with dojo.xhrGet()?
Being new to dojo I'm a bit confused this doesn't just work like in JQuery ...
Can anyone help??
Thanks,
thomas
We need more details! If you don't provide enough info you'll never get the right answer.
Anyway, if the HTML snippet is loaded inside a ContentPane, use a dojox.layout.ContentPane (is an extension to dijit.layout.ContentPane providing script execution).Or you could use one of the script tags that dojo accept. E.g:
<div dojoType=...>
<script type="dojo/connect" event="functionToConnectTo">
//javascript here
</script>
</div>
More valuable information about script tags on dojo parser reference.
I'm restructuring a page for a client, and I'm having some issues with the jQuery code I implemented on the page.
There's a pop-up lightbox that uses Prototype which appears when the page loads, and then there's marquee/scrollers on the top and right that I put there that use jQuery. I'm really unsure about what's causing the error.
I'm familiar with jQuery's noConflict, but I've tried pretty much every variation of it on this page and I still get an error - after a few seconds the marquees stop - and IE displays that "Errors on page" dialog, referencing line 464 ("Array length must be assigned a finite positive number").
Here is the page: -link removed by author-
Here is prototype.js: -link removed by author-
I have absolutely no idea what is causing this error and JavaScript isn't my strongest side.
When I first started seeing this error, I was Googling around for more general "Prototype + jQuery" errors, when I should have been looking for a solution specific to the exact problem I was dealing with.
Adding the terms "array length" and "line 464" actually led me to the solution to this specific problem, and here it is:
Updated from prototype v1.4 to v1.5.1.2 (v1.7, the latest release,
didn't work right and even produced a stack overflow error).
Changed around the order of the scripts, and changed noConflict:
<script src="/scripts/jquery-1.5.2.js" type="text/javascript"></script>
<script src="/scripts/jquery.Scroller-1.0.src_4.js" type="text/javascript"></script><!-- all _$_'s replaced with _jQuery_ -->
<script type="text/javascript">
<!--
// more jquery, all $'s replaced with jQuery
-->
</script>
<script type="text/javascript">
<!--
jQuery.noConflict();
-->
</script>
<script src="scripts/prototype-1.5.1.2.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
// everything else, including prototype scripts
-->
</script>
And that's it! Now I don't get the "Line 464" error and all scripts work fine.
Thank you #Ken and #Diodeus for leading me to the solution.
You may need to go through the plugins and replace $( with jQuery(, since you need to use "jQuery..." instead of "$..." in no-conflict mode.
Surround the code that uses jQuery with
(function ($) {
... // Your code
})(jQuery)
This way it uses local $ which is bound to jQuery and and jQuery only.
Also it is considered a bad idea to use both frameworks on the same website. You can find jQuery replacements for pretty much all of Prototype plugins.
I would find plugins in the same library. jQuery has all the plugins you mentioned, so there's no need to try using both. These two libraries can be difficult to get working together.
If you're set on using both libraries, try this ordering:
1) other lib
2) jquery
3) noconflict call
4) all plugins
<script src="scripts/prototype.js" type="text/javascript"></script>
<script src="/scripts/jquery-1.5.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
$.noConflict();
-->
</script>
<script src="/scripts/jquery.Scroller-1.0.src_3.js" type="text/javascript"></script>
<script src="scripts/lightbox.js" type="text/javascript"></script>