Click here to Skip to main content
15,893,266 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Looking for team Pin
Richard MacCutchan17-Jun-13 23:35
mveRichard MacCutchan17-Jun-13 23:35 
GeneralRe: Looking for team Pin
ashkanpower18-Jun-13 0:49
ashkanpower18-Jun-13 0:49 
QuestionHTML issue with IE. Pin
InderK17-Jun-13 3:17
InderK17-Jun-13 3:17 
AnswerRe: HTML issue with IE. Pin
Richard Deeming17-Jun-13 4:46
mveRichard Deeming17-Jun-13 4:46 
GeneralRe: HTML issue with IE. Pin
InderK19-Jun-13 1:25
InderK19-Jun-13 1:25 
AnswerRe: HTML issue with IE. Pin
Dholakiya Ankit10-Aug-13 1:43
Dholakiya Ankit10-Aug-13 1:43 
AnswerRe: HTML issue with IE. Pin
Dholakiya Ankit12-Sep-13 1:10
Dholakiya Ankit12-Sep-13 1:10 
Questionjquery/jquerymobile - image inside collapsible>listview Pin
Prasoon Chaudhary13-Jun-13 6:57
Prasoon Chaudhary13-Jun-13 6:57 
I am trying to create a dynamic collapsible-set which would contain text and image. Texts are appearing fine but as soon as I try to write code (see commented line) for image, browser doesn't display it correctly. It takes 2-3 clicks to open the collapsible, and it gets stuck most of the time. Here is my code:
<pre lang="Javascript">
$("#dvAccordion").empty();
var outdiv = $('<div data-role="collapsible-set"></div>');
$(strXML).find('Category').each(function(){
    var colldiv = $('<div data-role="collapsible" data-collapsed="true"></div>');
    colldiv.append('<h3>' + $(this).find('Category_Name').text() + '</h3>');    
    var uldiv = $('<ul data-role="listview" data-inset="false"></ul>');
    colldiv.append(uldiv);
    //
    $(this).find('Menu_Item').each(function(){          
        var sItemName = $(this).find('item_name').text() ;
        //var sImageUrl = $(this).find('item_image').text() ;
        var sImageUrl = "images/food1.jpg" ;
        uldiv.append('<li><a href="menu.html" rel="external">' + sItemName + '</li>');
        //uldiv.append('<li><a href="menu.html" rel="external"><img width="50" height="50" src="' + sImageUrl + '" />' + sItemName + '</a></li>');  
    });
    //
    outdiv.append(colldiv);
    outdiv.appendTo('#dvAccordion');
});
//$('#dvAccordion [data-role=collapsible-set]').collapsibleset();
//$('#dvAccordion').collapsibleset('');
//$('#dvAccordion').collapsibleset('refresh');
$('#dvAccordion').trigger('create');


Where am I wrong? If I try to generate the collapsible with listview and images static way in html - everything works fine.

jsFiddle - http://jsfiddle.net/yesprasoon/68v8p/
Surprisingly, images are appearing properly in fiddle. But it doesn't appear in my local file/ localhost address/ phonegap application. Frown | :-(

modified 15-Jun-13 9:45am.

QuestionjQuery - getting selected item of dynamic listview Pin
Prasoon Chaudhary13-Jun-13 6:13
Prasoon Chaudhary13-Jun-13 6:13 
AnswerRe: Free java online course Pin
dusty_dex12-Jun-13 2:15
dusty_dex12-Jun-13 2:15 
GeneralRe: Free java online course Pin
Richard MacCutchan12-Jun-13 2:30
mveRichard MacCutchan12-Jun-13 2:30 
GeneralRe: Free java online course Pin
dusty_dex12-Jun-13 7:02
dusty_dex12-Jun-13 7:02 
QuestionPassing objects byref between html windows Pin
tiwal11-Jun-13 23:30
tiwal11-Jun-13 23:30 
QuestionCalling a function from within a function question Pin
Calufrax1211-Jun-13 14:06
Calufrax1211-Jun-13 14:06 
AnswerRe: Calling a function from within a function question Pin
Dennis E White11-Jun-13 15:40
professionalDennis E White11-Jun-13 15:40 
AnswerRe: Calling a function from within a function question Pin
thanh_bkhn11-Jun-13 15:55
professionalthanh_bkhn11-Jun-13 15:55 
GeneralRe: Calling a function from within a function question Pin
Calufrax1213-Jun-13 15:25
Calufrax1213-Jun-13 15:25 
QuestionEnable / Disable textbox controlled by drop-down menu in PHP Pin
swapnilwebsite11-Jun-13 1:01
swapnilwebsite11-Jun-13 1:01 
QuestionSend Data to ASPX Page Pin
ASPnoob9-Jun-13 4:56
ASPnoob9-Jun-13 4:56 
AnswerRe: Send Data to ASPX Page Pin
Dennis E White9-Jun-13 18:48
professionalDennis E White9-Jun-13 18:48 
QuestionActiveX Object in javascript can not create after host it Pin
kuntala kumari mahanta8-Jun-13 0:38
kuntala kumari mahanta8-Jun-13 0:38 
AnswerRe: ActiveX Object in javascript can not create after host it Pin
Dennis E White8-Jun-13 19:53
professionalDennis E White8-Jun-13 19:53 
GeneralRe: ActiveX Object in javascript can not create after host it Pin
kuntala kumari mahanta9-Jun-13 19:40
kuntala kumari mahanta9-Jun-13 19:40 
GeneralRe: ActiveX Object in javascript can not create after host it Pin
dusty_dex9-Jun-13 22:13
dusty_dex9-Jun-13 22:13 
QuestionPassing Element ID to ASP.net Pin
ASPnoob7-Jun-13 16:31
ASPnoob7-Jun-13 16:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.