- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm working on an app that has a "login" button.
When the user types in their credentials and clicks "log in" I display an animated GIF (spinning wheel).
That only works when I include a full path to the file in the code, i.e; c:\apps\xdk\images\file.gif
This does not get included in the test "push" and I'm guessing also not in a build.
My question: How do I add a picture to my app that will get included in both the test and the build?
thanks
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried using adding this way?
So if you see the media on the left side. You can select image and provide the path.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Shawn,
I would say, use a relative path. From where you are accessing the image:
../images/login.png
will move you back one folder.
../../images/login.png
will move you back two folders.
/images/login.png
will take you back to the root folder no matter where you are.
To open the image in a new window, use the InAppBrowser plugin. This will be a simple event handler in your 'js/app.js':
function localImg() { var ref = window.open('images/login.jpg', '_blank', 'location=yes'); }
Bind this to your login button and see how it works. You should include the inappbrowser plugin from Project tab -> Plugin. Just tick the plugin from the Standard Cordova plugins list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got it figure out.
I was looking in the wrong folder!!!
d'oh!
thanks for your help
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page