Showing posts with label jQuery. Show all posts
Showing posts with label jQuery. Show all posts

Wednesday, December 22, 2010

Friday, August 20, 2010

Cross-Domain & jsonp (java struts, php, asp.net mvc, otros )

Cross-Domain Proxy
En el caso de Ajax, por seguridad sólo se permite acceder al mismo dominio origen de la página web que realiza la petición. Si se necesita acceder a otros servicios localizados en otros dominios, se instala un Cross-Domain proxy en el dominio origen que recibe las peticiones ajax y las reenvia a los dominios externos.

Con jsonp es posible la llamada cross-domain, debido a que no es una llamada ajax sino una carga de un script js completo que lanza una función que definimos en la url y que actúa como callback.

Mientras que por motivos de seguridad es lógico que Ajax no funcione en dominios distintos al que lanza la web; con esta técnica JSON con Padding se genera un archivo JSON dinámicamente dejandolo abierto en el script que lo crea. Una variable que podemos definir nosotros mismos en la url será colocada antes del objeto Json, así al crear el script Json decidimos que variable "callback" usar.


Referencias

[1] jQuery y Strust
http://blog.pontt.com/json-con-java/generar-respuesta-en-java-struts-para-getjson-de-jquery/
[2] jQuery y php http://www.9lessons.info/2009/12/display-cross-domain-data-json-callback.html
[3] jQuery y Asp.Net Mvc (cross-domain JSON to ASP.NET MVC with jQuery)
http://www.integratedwebsystems.com/2010/07/cross-domain-jsonp-using-asp-net-mvc-and-jquery/
[4] cross-domain JSON to ASP.NET MVC with jQuery II
http://stackoverflow.com/questions/2022878/posting-cross-domain-json-to-asp-net-with-jquery
[5] Genericos(muy buenos)
http://www.ibm.com/developerworks/library/wa-aj-jsonp1/
http://ox.no/posts/ajast-cross-domain-rest-calls-using-json-injection
[6] Json to JsonP (easy)
http://www.codeproject.com/KB/aspnet/JSONToJSONP.aspx
http://www.codedigest.com/Articles/jQuery/310_Calling_a_WebService_using_jQuery_in_ASPNet.aspx
[7] Cross-site data retrieval using JSONP http://www.stpe.se/2008/10/cross-site-data-retrieval-using-jsonp/

Wednesday, June 16, 2010

Cross-site data retrieval

Using jQuery for load webService on Same domain
http://encosia.com/2008/03/27/using-jquery-to-consume-aspnet-json-web-services/

Using Proxy
http://www.west-wind.com/weblog/posts/324917.aspx

Flicker service
http://www.adictosaltrabajo.com/tutoriales/tutoriales.php?pagina=jQueryAjaxRESTfulWebServiceJSON

Tuesday, January 26, 2010

Scripts Java & jQuery

Timers
====================



setInterval("reloj()",1000);

function reloj() {

var fObj = new Date() ;
var horas = fObj.getHours() ;
var minutos = fObj.getMinutes() ;
var segundos = fObj.getSeconds() ;

if (horas <= 9) horas = "0" + horas; if (minutos <= 9) minutos = "0" + minutos; if (segundos <= 9) segundos = "0" + segundos; window.status = horas+":"+minutos+":"+segundos; } setTimeout("document.location.href='http://www.google.es';",5000); //5seg. setInterval("reloj()",1000); setTimeout("clearInterval("+id+")",15000); setTimeout("clearInterval('reloj')",15000); Work with IFrame ============= < id="'iFrame'" onload="'onIFrameLoad();'">
$("iFrame").src = "sumGet.phtml?figure1=5&figure2=1";

function onIFrameLoad()
{
var serverResponse = extractIFrameBody($("iFrame")).innerHTML;
$("response").innerHTML = serverResponse;
}


var iFrameBody = extractIFrameBody($("iFrame"));
iFrameBody.innerHTML =
"<form action="'sumPostForm.phtml'" method="'POST'">" +
"<input name="'figure1'" value="'5'" type="'text'">" +
"<input name="'figure2'" value="'2'" type="'text'">" +
"</form>";



var form = iFrameBody.firstChild;
form.submit();

var iFrameBody = document.getElementById("iFrame").contentWindow.document.body;
iFrameBody.innerHTML = "whatever html code you want";
#iFrame {
display : none;
visibility : hidden;
height : 1px;
}

reset all styles margin & padding
* {
margin: 0;
padding: 0;
}



* { margin:0; padding:0; }
body {
line-height: 1;
color: black;
background: white;
}
p { margin:5px 0 10px 0; }
}
body {
line-height: 1;
color: #996633
background:#ccc url(your-tiled-image.gif) repeat-x top left;
}


referencias:
http://ideamill.synaptrixgroup.com/?p=6
http://www.dyn-web.com/tutorials/iframes/
http://stackoverflow.com/questions/997986/write-elements-into-a-child-iframe-using-javascript-or-jquery

Upload
http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=280
http://www.codeweblog.com/upload-file-false-ajax/
http://css.dzone.com/news/upload-files-like-gmail-client

Thursday, October 15, 2009

jQuery con JSP

http://rekkeb.wordpress.com/2009/03/15/comunicar-jsp-y-jquery/

Thursday, August 27, 2009

jQuery Plugins

mas plugins

http://devsnippets.com/reviews/using-jquery-to-style-design-elements-20-impressive-plugins.html
http://www.extjs.com/deploy/dev/examples/grid/grouping.html

JQTreeTable
http://www.hanpau.com/index.php?page=jqtreetable

tablesorter
http://tablesorter.com/docs/example-empty-table.html

flexigrid
http://www.flexigrid.info/

Ingrid, the jQuery Datagrid.
http://www.reconstrukt.com/ingrid/src/example1.html#

Grouping rows by column
http://dhtmlx.com/docs/products/dhtmlxGrid/samples/07_extended_modes/01_pro_group.html


http://www.treegrid.com/treegrid/www/#%27BooksExample

single group
http://p.sohei.org/stuff/jquery/tablegroup/demo/demo.html

Sorter
http://www.pengoworks.com/workshop/jquery/tablesorter/tablesorter.htm

Autocomplete
http://www.esasp.net/2010/05/jquery-autocomplete-facebook-con-aspnet.html

Saturday, August 22, 2009

Filtrado de tablas por columnas

Aveces uno necesita realizar un filro multiple, es decir seleccionar data en función a varios campos, puede ser por nombre, sexo, telefono etc., esta aplicación basada en jQuery es el mejor.

Firefox open multiple private window

    /opt/firefox/firefox-bin --profile $(mktemp -d) --private-window www.google.com www.bing.com