nativeDroid2
nativeDroid2 copied to clipboard
nd2-include in phonegap
Hi! Im having troubles using the helper n2-include, even if a put the .html file in the root folder (www), console shows that jquery its unable to load it. Im trying to load a panel just like in the expample. Jquery complains POST http://192.168.1.130:3000/panel-left.html 404 (Not Found) and get the message Cannot POST /panel-left.html. Im using the phonegap serve --browser command.
sounds like a path error. check the tag and whats the href it should be href="examples/fragments/panel.left.html"
Hi paz. Well index and the html file are in the same directory. Example shows the following markup
can you show us the code ? it would be easier to find the issue and give you a solution
unable to load left panel...
ehmm...the code...not the screenshot...
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css" />
<link rel="stylesheet" href="vendor/waves/waves.min.css" />
<link rel="stylesheet" href="vendor/wow/animate.css" />
<link rel="stylesheet" href="css/nativedroid2.css" />
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
</head>
<body>
<div data-role="page">
<nd2-include data-src="examples/fragments/panel.left.html"></nd2-include>
<div data-role="panel" id="bottomsheet" data-animate="false" data-position='bottom' data-display="overlay">
<nd2-include data-src="examples/fragments/bottom.sheet.html"></nd2-include>
</div>
<div data-role="header" data-position="fixed" class="wow fadeInDown" data-wow-delay="0.2s">
<a href="#bottomsheet" class="ui-btn ui-btn-right wow fadeIn" data-wow-delay='1.2s'><i class="zmdi zmdi-more-vert"></i></a>
<a href="#leftpanel" class="ui-btn ui-btn-left wow fadeIn" data-wow-delay='0.8s'><i class="zmdi zmdi-menu"></i></a>
<h1 class="wow fadeIn" data-wow-delay='0.4s'>Page Title</h1>
</div>
<div role="main" class="ui-content" data-inset="false">
<p>(home)</p>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"></script>
<script src="vendor/waves/waves.min.js"></script>
<script src="vendor/wow/wow.min.js"></script>
<script src="js/nativedroid2.js"></script>
<script src="nd2settings.js"></script>
</body>
both files (index and panel.left.html) are in the same level directory
console shows 404 error when trying to post the file
The path works fine
Using, html <nd2-include data-src="panel.left.html"></nd2-include>
and html <nd2-include data-src="/panel.left.html"></nd2-include>
makes no difference the error is still there
Hope you can help me.
Works on apache under localhost prefix... some phonegap server issue ?
<script type="text/javascript">$("#main").load("/panel.left.html")</script>
works fine but because its not triggered at pagecreate event it wont load styles.
keeping both files (index and panel.left.html) are in the same level directory loads sidebar.... But
after clinking any link.... like text elements,,,, it show following error 
This issue is may related to this ticket: https://github.com/godesign/nativeDroid2/issues/31
Hi guys, i read the thread and the related #31 too. I avoid to open another issue because mine is pretty similar to this one.
Differently from @arieltoledo, seems that my app has a problem since I updated the nd2 version to the last one. I got a Phonegap Build app and before that, the panels were normally opened in browser - and onto the simulator and the compiled version too - of the app. But now (after the update), in the apk version, the panels cannot be opened or aren't loaded neither. I don't know with certainty, because no 4xx/5xx/POST errors are catched from the console log (debugged with local weinre set-up). Simply, I touch the hamburger icon and nothing happens. However, the panels still works fine on browser and the emulator (I'm using the official Phonegap Developer App with the same local debugging, plus the extension Ripple for Chrome). As I said, I read about the issue #31 and I'm starting to think that maybe it can be related to the change made by @godesign from GET to POST. I still have the previous version of the repository, with the old files, were the panels works normally in the compiled app version too.
Any suggestion to solve this situation?
Thanks everyone.
EDIT: Solved. It was a bad codeline that caused a graphic glitch which involved z-index of the items and their visibility in the DOM.
XAMPP 503 Error when directory named "examples". I confirm the same behaviour for Drupal 7 on XAMPP 1.7.4 even without TomCat installed: the parts of Examples module end up showing "Service unavailable!" error bacause of the preconfigured redirect.
To fix it navigate to file: C:\xampp\apache\conf\extra\httpd-ajp.conf and comment out the following line with #: ProxyPass /examples ajp://127.0.0.1:8009/examples smax=0 ttl=60 retry=5 Then restart the server and enjoy these great Examples.