Overblog
Suivre ce blog Administration + Créer mon blog

JQuery + Cordova : rechercher un lien dans une page html

13 Avril 2015 , Rédigé par Hugues MEUNIER

Le code ci-dessous permet de rechercher un lien dans une page html en jquery (mobile), d'appeler ce lien et remplir une DIV avec une partie du contenu envoyé. Le tout est développé avec Cordova (si vous cherchez comment utiliser jquery mobile avec Cordova).

<head>
<meta charset="utf-8" />
<title>Montitre</title>


<!--references -->
<link href="css/index.css" rel="stylesheet" />

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>

<!-- Cordova reference, this is added to your app when it's built. -->
<script src="cordova.js"></script>
<script src="scripts/platformOverrides.js"></script>


<script src="scripts/index.js"></script>

<div data-role="page">
<a name="haut" id="haut"></a>
<div data-role="main" class="ui-content" id="home">
</div>
</div>
</body>
</html>
<script>

$.ajax({

//change the string url here
url: 'http://www.monurl.fr/',
type: 'GET',
success: function (res) {

//venta is the class of the DIV contained my href

// you can find by id #myID
var headline = $(res).find('.venta').html();
// build the string with URI + the relative link found
var strUrl = 'http://www.monurl.fr/' + jQuery("a", headline).attr("href");

//build the string with the content you want to show in your div named contenu and take only the part <p></p>
var resUrl = strUrl + ' #contenu p';
//alert(resUrl);
$("#home").load(resUrl);
}
});
</script>

Lire la suite

Des ressources pour se former à SCRUM

7 Avril 2015 , Rédigé par Hugues MEUNIER

ScrumInc une entreprise créée par Jeff Sutherland met à disposition plein de contenus pour se former à la méthode SCRUM, c'est ici et c'est gratuit :

http://www.scruminc.com/scrumlab-open/

Il y a une variante payante (50 USD par an) pour avoir accès à tous les contenus.

Bon Scrum !

Lire la suite