Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Monday, January 11, 2016

CDN for javascript libraries

It is best practice to have content delivery network to host common library files. This post wil bring you the few informations about available well known CDNs. For hosting Jquery below are the available locations

Google CDN
It provides a high availability, low latency resource for delivering scripts to websites. It hosted Libraries including jQuery, AngularJS, Prototype and Dojo.

ajax.googleapis.com/ajax/libs/jqueryui/[VERSION NO]/jquery-ui.min.js
ajax.googleapis.com/ajax/libs/jqueryui/[VERSION NO]/themes/[THEME NAME]/jquery-ui.min.css
for details list of libraries are provided at https://developers.google.com/speed/libraries/#jquery

Microsoft CDN

For websites built in ASP.NET, Microsoft’s CDN provides a support for JavaScript frameworks without having delay. The same files can be access for other websites as well. Below is the path

ajax.aspnetcdn.com/ajax/jquery.ui/[VERSION NO]/jquery-ui.min.js
ajax.aspnetcdn.com/ajax/jquery.ui/[VERSION NO]/themes/[THEME NAME]/jquery-ui.min.css
For more detailed Microsoft CDN content visit https://docs.microsoft.com/en-us/aspnet/ajax/cdn/overview

jQuery CDN

code.jquery.com/ui/[VERSION NO]/jquery-ui.min.js
code.jquery.com/ui/[VERSION NO]/themes/[THEME NAME]/jquery-ui.min.css
jquery dot com provides various version for UI, mobile, color etc., visit http://code.jquery.com

Yandex CDN

A russian provider who also provide Javascript libraries and CSS including Bootstarp, angular JS
https://yastatic.net/jquery/[VERSION NO]/jquery.min.js

It provides Backbone.js, Bootstrap, D3.js, jQuery, Lo-Dash, Raphaёl, React, SWFObject, Underscore.js, bem-components. visit
https://tech.yandex.ru/jslibs/


http://www.bootstrapcdn.com/

community-powered CDN https://cdnjs.com/api

Beside this, there are many commercial entities to provide CDN services for hosting custom contents. you can host your own scripts,

images, multimedia files without delay.
www.akamai.com
www.cloudflare.com
www.fastly.com
for more providers visit http://blog.cloudharmony.com/2015/02/cdn-marketshare-alexa-fortune-500.html

Sunday, April 22, 2012

DHTML blogger comments

This post will describe about some techniques to comment a blogger site with DHTML content. especially dedicated to Ifinder

DHTML is nothing but Dynamic HTML and which is the combination of HTML, Javascript, CSS, HTML DOM. As we discussed in HTML comments for Blogger site post, using NCcode we can post HTML contents which gives you customized style of comments. Since external javascript are not secure, though NCcode recognize javascript, it will not accept external javascript. But javascript can be used without functions and variables.

below are the few examples for including javascripts in blogger comments(for non-techies please replace the highlighted parts with your images.)

Effect: on click, image toggle


NCcode:
〈img onclick="if (this.src=='http://www.w3schools.com/dhtml/bulboff.gif'){this.src='http://www.w3schools.com/dhtml/bulbon.gif';}else{this.src='http://www.w3schools.com/dhtml/bulboff.gif';}" border="0" src="http://www.w3schools.com/dhtml/bulboff.gif" width="100" height="180" /〉


Effect: Anchor tag on particular pixel(Map effect)
Venus

NCcode:
〈img src="http://www.w3schools.com/jsref/planets.gif" width="145" height="126" usemap="#planetmap" /〉〈map name="planetmap"〉 〈area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="http://www.w3schools.com/images/venglobe.gif" /〉 〈/map〉


Effect: Hide/unhide the comments




you can hide me.
NCcode:
〈input type="button" value="Hide text" onclick="document.getElementById('pic').style.visibility='hidden'" /〉〈input type="button" value="Show text" onclick="document.getElementById('pic').style.visibility='visible'" /〉
〈p id="p1"〉you can hide me.〈/p〉


Effect:mouse over enlarge the image


NCcode:
〈img id="image" src="http://www.w3schools.com/dhtml/bulbon.gif" onmouseover="this.width='200';this.height='360';" onmouseout="this.width='100';this.height='180';" width="100" height="180" /〉


If you notice you would have found one thing that is javscript can be included in events like onMouseout, onMouseover, Onclick... you can develop complex javascripts with in events and you can make the effect in blogger comments. If you use image toggling effect, then it would reduce your page loading time comparing to large images


Suggestion for Blog owner:
If you are good in javascript, then allow the javascripted comments while moderating your blog comments. If not Please don't allow any javascripted comments it may have span links.



Reference:W3shools

Thursday, March 1, 2012

Random gadgets for Bloggers


It is an interesting thing to show random messages or pictures or ads in the Website. you may love to show different messages on the same page when user visit same page again. That may be your picture, which have different pose on every refresh. Even that can be a blogger gadgets, on every refresh on the same page you can make to get random gadgets. This type of Randoming will make different look on your pages. Let see how to make random elements

Thursday, February 2, 2012

How to avoid country specific Blogspot URL

Recently Blogger has announced country code Top Level Domain (ccTLD) for few countries like India, Australia,.. As per Blogger note, it will be launched for more countries in near futures. Technically, which means a visitors from these countries will be redirected to their ccTLD eg) an Indian visitor view my blog as macrolayer.blogspot.in & australian visitor view my blog as macrolayer.blogspot.com.au.

Sunday, January 22, 2012

Full HTML access for Blogger Comments

Lets break the rules for commenting in Blogger website.

As you know NCcode made blogger comments to show images, texts, and more with some syntax. But there was few discussions with fellow bloggers on personalized needs. and Ncode was also frequently updated with more syntax to adhere the commentors wish.

Now time for releasing the new feature to accrue HTML syntax. You have to do just a single conversion from HTML to NCcode and post it in blogger website. This will help you to post comments with HTML code

Saturday, December 31, 2011

AppsScript - Macro - Javascript

Google Apps script and VBA Macro and Javascript are the powerful scripts which work on worksheets. Depending on the usage of the worksheet we can choose any of the above scripts. let say, If you need online automation then Appscript would be the best of the choice. For local automation Macro and Javascript play vital role. Many of us are not sure about similarities on these. In this series, I would like to share the similarities on these scripts. In this post let see how to read the spreadsheets

For reading the worksheet:
Google Apps Script for reading another spread sheet

  var myBook = spreadsheetApp.openById("0Aoh6e6FJ10dSGc"); // open id is the key string able to find in the spread sheet url 
var mySheet = myBook.getSheetByName("sheet1");   //name of the sheet
var myRange = mySheet.getRange(1,1).getValue();   // range represent first row first column
   
VBA Macro Script for reading another Worksheet
Dim myBook as Excel.workbook
set myBook = Getobject("C:\sample\book1.xls")
myRange =  myBook.worksheets(1).Cells(1,1).Value
myBook.Close 'make sure this needs to be closed, if it is declared early.


JavaScript for reading another Worksheet

var myBook = new ActiveXObject("Excel.Application").workbooks.open("c:\sample\book1.xls");
var mySheet = myBook.Sheets(1);
var myRange = mySheet.cells(1,1).Value;  //ActiveXObject is supported by IE only & other browsers are not supportable

  myRange is the Read value 


on simple way we can compare these as
SpreadsheetApp.openById("0Aoh6e6FJ10dSGc").getSheetByName("sheet1").getRange(1,1).getValue());

new ActiveXObject("Excel.Application").workbooks.open("c:\sample\book1.xls").Sheets(1).cells(1,1).Value;

Getobject("C:\sample\book1.xls").worksheets(1).Cells(1,1).Value