I'm newbie developing a phonegap app. I already checked those posts: jquery.load() not working on phonegap and how to load pages using jquery load() in phonegap and jquery .load() function does not work under phonegap... but nothing seems to help.
I'm developing an app in phonegap with jquery and an external device to run it instead of an emulator. I have 2 html: breakfast.html and tab.html
My folder structure is:
▸ merges/
▸ platforms/
▸ plugins/
▾ www/
▸ css/
▸ img/
▸ js/
▸ res/
▸ spec/
▾ static_pages/
▾ layouts/
tab.html
breakfast.html
config.xml
icon.png
index.html
spec.html
My Breakfast.html is
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="../css/custom_forms.css" />
<title>Hello World</title>
<script type="text/javascript" src="../phonegap.js"></script>
<script type="text/javascript" src="../js/index.js"></script>
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
app.initialize();
</script>
</head>
<body>
<header class="navbar navbar-fixed-top">
XXXXXXX
</header>
<div id="testing"></div>
<script>$( "#testing" ).load( "layouts/tab.html #test" );</script>
<footer class="navbar" id="footer_bottom">
XXXXXXXX
</footer>
</body>
</html>
My tab.html is:
<div id="test" style="width:100%;heigt:90px;background:black;color:white;">
TESTING JQUERY
</div>
Regarding to official api.jquery.com/load page what I have to do to insert a part of an html file with an id I have to do next:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>load demo</title>
<style>
body {
font-size: 12px;
font-family: Arial;
}
</style>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<b>Footer navigation:</b>
<ol id="result"></ol>
<script>
$( "#result" ).load( "ajax/test.html #container" );
</script>
</body>
</html>
I don't know what I'm doing wrong.
Does anyone faced this issue before and figure it out why?
Thanks in advance.
UPDATE:
Sorry, I'm developing for Android, and the device is a LG optimus 2X with android 4.2.2