OnClick without jQuery

When this anchor will contain only one function to handle on click, than you can just write document.getElementById(‘anchorID’).onclick=function(){/* some code */} otherwise, you have to use DOM method addEventListener function clickHandler(){ /* some code */ } var anchor = document.getElementById(‘anchorID’); if(anchor.addEventListener) // DOM method anchor.addEventListener(‘click’, clickHandler, false); else if(anchor.attachEvent) // this is for IE, because … Read more

OnclientClick and OnClick is not working at the same time?

From this article on web.archive.org : The trick is to use the OnClientClick and UseSubmitBehavior properties of the button control. There are other methods, involving code on the server side to add attributes, but I think the simplicity of doing it this way is much more attractive: <asp:Button runat=”server” ID=”BtnSubmit” OnClientClick=”this.disabled = true; this.value=”Submitting…”;” UseSubmitBehavior=”false” … Read more

start/play embedded (iframe) youtube-video on click of an image

The quick and dirty way is to simply swap out the iframe with one that has autoplay=1 set using jQuery. THE HTML Placeholder: <div id=”videoContainer”> <iframe width=”450″ height=”283″ src=”https://www.youtube.com/embed/VIDEO_ID_HERE?wmode=transparent” frameborder=”0″ allowfullscreen wmode=”Opaque”></iframe> </div> Autoplay link: <a class=”introVid” href=”#video”>Watch the video</a></p> THE JQUERY The onClick catcher that calls the function jQuery(‘a.introVid’).click(function(){ autoPlayVideo(‘VIDEO_ID_HERE’,’450′,’283′); }); The function /*——————————– … Read more

How to add click event to a iframe with JQuery

There’s no ‘onclick’ event for an iframe, but you can try to catch the click event of the document in the iframe: document.getElementById(“iframe_id”).contentWindow.document.body.onclick = function() { alert(“iframe clicked”); } EDIT Though this doesn’t solve your cross site problem, FYI jQuery has been updated to play well with iFrames: $(‘#iframe_id’).on(‘click’, function(event) { }); Update 1/2015 The … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)