-
Re: images path issue in add-on
gopi.gorantala Aug 16, 2016 2:09 AM (in response to gopi.gorantala)Scott A Johnson - Any idea on this ? I am getting this error.
GET https://XXXXXXXXXXXXXX.XXX/gadgets/telephone_tr.gif 404 (Not Found)
-
Re: images path issue in add-on
Scott A Johnson Aug 16, 2016 9:38 AM (in response to gopi.gorantala)How are you referencing the image in javascript? I'm not exactly sure what you're trying to do. Can you share a code sample?
Thanks,
Scott
-
Re: images path issue in add-on
gopi.gorantala Aug 17, 2016 12:30 AM (in response to Scott A Johnson)My project structure is below with expanded and collapsed view -
My code actually creates dynamic thumbnails by calling "createUser.js", And the images path is hardcoded in the "createUser.js" file as I want these images to appear in each thumbnail. But the path I gave below is not working, I tried few other paths and its not working too.
<img class="j-user-designation images" src="public/images/cardsprite.png" style="width:10px;height:10px;margin-right:5px;"/>
-
Re: images path issue in add-on
Scott A Johnson Aug 17, 2016 9:51 AM (in response to gopi.gorantala)The relative path you're providing should be relative to the path of the page you're viewing (which loads createUsers.js). I assume the page being loaded is orgStructure.html which appears to be in the public folder, which means your relative url should be "images/cardsprite.png"
Hope this helps,
Scott
-
Re: images path issue in add-on
gopi.gorantala Aug 17, 2016 9:59 AM (in response to Scott A Johnson)I tried that, but it did not work at all. It gave me the below error as above
GET https://XXXXXXXXXXXXXX.XXX/gadgets/images/telephone_tr.gif 404 (Not Found)
-
Re: images path issue in add-on
Scott A Johnson Aug 17, 2016 10:19 AM (in response to gopi.gorantala)What is the url of the createUsers.js file?
-
Re: images path issue in add-on
gopi.gorantala Aug 17, 2016 10:31 AM (in response to Scott A Johnson)orgStructure.html is my Add-on landing page.
I have a div ID("divID") inside the orgStructure html, which I append the successive thumbnails by calling the file createUser.js file each time.
<div id="divID" class="emp-attr-dis" style="width: 100%;height: 50%;margin: 0;padding: 0;overflow: auto;"/>
function createTable(userID, username) {
$('#divID').append('<TABLE id="dataTable">' +
'<tbody width="100%">' +
'<tr>' +
......
....// some code
...
<img class="j-user-designation images" src="images/cardsprite.png" style="width:10px;height:10px;margin-right:5px;"/>
'</tbody>' +
'</TABLE>');
}
The image won't get displayed in the page and shows an error 404 not found
-
Re: images path issue in add-on
Scott A Johnson Aug 17, 2016 10:37 AM (in response to gopi.gorantala)Hi Gopi,
Is that createTable function within the createUser.js file? How are you referencing/loading the js file in your html file?
Thanks,
Scott
-
Re: images path issue in add-on
gopi.gorantala Aug 17, 2016 12:10 PM (in response to Scott A Johnson)yes createTable function is inside the createUser.js file. I am referring all the JS files in my HTML as below -
<script type="text/javascript" charset="utf-8" src="javascripts/app/createUser.js"></script>
-
Re: images path issue in add-on
Scott A Johnson Aug 17, 2016 12:32 PM (in response to gopi.gorantala)Strange. If you create a static reference to the image does it load?
-
Re: images path issue in add-on
gopi.gorantala Aug 17, 2016 1:15 PM (in response to Scott A Johnson)no, its not loading at all. Any idea ?
-
Re: images path issue in add-on
Scott A Johnson Aug 17, 2016 1:33 PM (in response to gopi.gorantala)Jive appears to modify those urls internally to look something like this:
https://xxxx.xxx/resources/add-ons/[add-on-id]/[some-other-id]/apps/[app-name]/images/cardsprite.png
It may be difficult to explicitly reference the original url in your js file. Can you try moving your javascript to the .html file and see if that images url gets modified?
-
Re: images path issue in add-on
gopi.gorantala Aug 18, 2016 8:27 AM (in response to Scott A Johnson)Scott A Johnson - I moved the createUser JS file to the html file, still the images are not appearing, tried with few different path hits and they did not work at all.
My add-on url looks something like - https://XXXXXXXXXX.XX.XXX/community/developer-space/apps/[App ID]/organic-ram , can you now point me how the images are accessible using this url ?
-
Re: images path issue in add-on
gopi.gorantala Aug 19, 2016 3:02 AM (in response to gopi.gorantala)hey Scott A Johnson,
you are right with the path, to get the [some-other-id] as per your comment above and I found it in the file system and now all the images are displaying properly. Thanks
-
Re: images path issue in add-on
Scott A Johnson Aug 19, 2016 8:36 AM (in response to gopi.gorantala)Ok, good to hear.
-
-
-
-
-
-
-
-
-
-
-
-
-
-