nativeDroid2 icon indicating copy to clipboard operation
nativeDroid2 copied to clipboard

nd2-include in phonegap

Open arieltoledo opened this issue 8 years ago • 12 comments

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.

arieltoledo avatar Oct 28 '15 18:10 arieltoledo

sounds like a path error. check the tag and whats the href it should be href="examples/fragments/panel.left.html"

well-it-wasnt-me avatar Oct 28 '15 18:10 well-it-wasnt-me

Hi paz. Well index and the html file are in the same directory. Example shows the following markup thats the right way? Or should it be

arieltoledo avatar Oct 28 '15 20:10 arieltoledo

can you show us the code ? it would be easier to find the issue and give you a solution

well-it-wasnt-me avatar Oct 28 '15 20:10 well-it-wasnt-me

untitled

unable to load left panel...

viraj310 avatar Oct 29 '15 15:10 viraj310

ehmm...the code...not the screenshot...

well-it-wasnt-me avatar Oct 29 '15 17:10 well-it-wasnt-me

nativeDroid II - jQueryMobile Template

    <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>

viraj310 avatar Oct 29 '15 19:10 viraj310

both files (index and panel.left.html) are in the same level directory

Image

console shows 404 error when trying to post the file

Image

The path works fine

Image

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.

arieltoledo avatar Oct 30 '15 17:10 arieltoledo

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.

arieltoledo avatar Oct 30 '15 17:10 arieltoledo

keeping both files (index and panel.left.html) are in the same level directory loads sidebar.... But

1

after clinking any link.... like text elements,,,, it show following error ![2](https://cloud.githubusercontent.com/assets/15348278/10855919/4c021bac-7f6a-11e5-9d74-e64f1dce0454.JPG)

viraj310 avatar Oct 30 '15 19:10 viraj310

This issue is may related to this ticket: https://github.com/godesign/nativeDroid2/issues/31

wildhaber avatar Nov 20 '15 13:11 wildhaber

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.

ghost avatar Nov 23 '15 16:11 ghost

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.

vnzlogin avatar Mar 02 '17 01:03 vnzlogin