Javascript Tip
A JS Tip per day! : http://www.jstips.co/
A JS Tip per day! : http://www.jstips.co/
pagePiling.js: http://www.alvarotrigo.com/pagePiling
fullPage.js: http://alvarotrigo.com/fullPage
Change browser url without page reloading: http://www.tinywall.info/2012/02/change-browser-url-without-page-reload-refresh-with-ajax-request-using-javascript-html5-history-api-php-jquery-like-facebook-github-navigation-menu.html
Demo: http://demo.tinywall.info/html5-history-api/menu1.php
How to make AJAX URLs Crawlable: http://ajax.rswebanalytics.com/seo-for-ajax/#!ajax-crawlable-urls
Solutions to 5 Common Ajax Problems: http://www.webdesignerdepot.com/2009/12/solutions-to-5-common-ajax-problems/
Changing the browser-URL without refreshing page: http://spoiledmilk.com/blog/html5-changing-the-browser-url-without-refreshing-page/
jquery: change the URL address without redirecting? [duplicate]: http://stackoverflow.com/questions/6478485/jquery-change-the-url-address-without-redirecting
Making AJAX applications crawlable: https://developers.google.com/webmasters/ajax-crawling/docs/learn-more
Crossroads.js is a routing library: http://millermedeiros.github.io/crossroads.js/
Good but it is better using Cookie at complexed page.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv=”content-type” content=”text/html; charset=UTF-8″>
<title>Simple History.js Ajax example </title>
<script type=”text/javascript” src=”http://code.jquery.com/jquery-1.8.2.js”></script>
<script type=”text/javascript” src=”https://browserstate.github.io/history.js/scripts/bundled/html4+html5/jquery.history.js”></script>
</head>
<body>
<ul class=”content_links”>
<li><a href=”page_1.html”>Content page 1</a></li>
<li><a href=”page_2.html”>Content page 2</a></li>
</ul>
<div id=”content”>
<p>Content within this box is replaced with content from supporting pages using javascript and AJAX.
</div>
<script>
$(function() {
// Prepare
var History = window.History; // Note: We are using a capital H instead of a lower h
if ( !History.enabled ) {
// History.js is disabled for this browser.
// This is because we can optionally choose to support HTML4 browsers or not.
console.log(‘aaa’);
return false;
}
// Bind to StateChange Event
History.Adapter.bind(window,’statechange’,function() { // Note: We are using statechange instead of popstate
var State = History.getState();
$(‘#content’).load(State.url);
/* Instead of the line above, you could run the code below if the url returns the whole page instead of just the content (assuming it has a `#content`):
$.get(State.url, function(response) {
$(‘#content’).html($(response).find(‘#content’).html()); });
*/
});
// Capture all the links to push their url to the history stack and trigger the StateChange Event
$(‘a’).click(function(evt) {
evt.preventDefault();
History.pushState(null, $(this).text(), $(this).attr(‘href’));
});
});
</script>
Do you want to keep your visitors on your website? One great way to support this is opening all external links on new browser tabs. Here’s a ridiculously simple way to achieve this with pure JavaScript.
http://webdevelopmentisawesome.com/tutorials/open-external-links-on-new-tab-with-javascript
Adding a Google Map with a Marker to Your Website : https://developers.google.com/maps/documentation/javascript/adding-a-google-map
Jquery Google Map http://tilotiti.github.io/jQuery-Google-Map/
jQuery Geocoding and Places Autocomplete Plugin http://ubilabs.github.io/geocomplete/
Get Coordinates of address http://stackoverflow.com/questions/3652951/google-maps-api-get-coordinates-of-address
https://developers.google.com/maps/documentation/javascript/examples/
Places search box https://developers.google.com/maps/documentation/javascript/examples/places-searchbox
<script type=”text/javascript”>
$(document).ready(function() {
$(‘.pic_gallery’).click(function() {
// console.log($(this).attr(‘id’).substr(5));
//change dialog iframe id href
url = “{{ URL::to(‘/picture/list’)}}” + “/” + $(this).attr(‘id’).substr(5);
// console.log(‘url: ‘ + url);
$(“#dialog_iframe”).attr(“src”, url)
$(“#dialog”).dialog(“open”);
//simple page load
// $(“#dialog2”).load(url);
// $(“#dialog2”).dialog(“open”);
});
$(“#dialog”).dialog({
autoOpen: false,
position: ‘center’,
title: ‘EDIT’,
draggable: true,
width: 700,
height: 450,
});
});
</script>
<div id=”dialog” style=”display:none;” title=”Dialog Title”><iframe id=”dialog_iframe” frameborder=”0″ scrolling=”no” width=”650″ height=”400″ src=””></iframe></div>
******
<a class=”pic_gallery” id=”link_{{$user->users_id}}” href=”#” > Click gallery </a>
Webtudor S1E13: Hogyan írjunk böngészős játékot?: https://www.youtube.com/watch?v=pr_19aztrUM&feature=youtu.be
Demo: https://github.com/Webtudor/S1E13
Böngészős játék készítő keretrendszer !! : https://phaser.io/
Read, manipulate and write spreadsheet data and styles to XLSX and JSON.
https://github.com/guyonroche/exceljs
Writing XLSX
// write to a file var workbook = createAndFillWorkbook(); workbook.xlsx.writeFile(filename) .then(function() { // done });
AngularJS == Javascript for MVC programmers
The video tutorial covers communicating and sharing state between controllers using a shared service and $rootScope.
http://www.youtube.com/watch?v=1OALSkJGsRw
The code: http://jsfiddle.net/simpulton/XqDxG/