first thanks for you help and support!
My question is how can i correctly make a correct output of html code with variables into. I´m working with jquery and jquery.mobile.
I´m getting from a php results of an database seperated with "," and splitted to an javascript array (works) but I´m not able to output these results correctly to an dynamically working list... they have to be in a list with links and jquery look... but it just show me a list with images without the link and without jquery also it don´t stop to load. My internet research don´t gave me the help I need and I don´t know how to solve this. (Because I want to use PhoneGap, I can´t use php in this part)
Here is my code fragment (just the important things):
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/jquery.mobile-1.2.0.css" />
<script src="js/jquery.js"></script>
<script src="js/jquery.mobile-1.2.0.js"></script>
</head>
<body>
<div id="result">
<script>
$(document).ready(function(){
$.post("Test.php",
{
q:"Value2ask",
},
function(data){
var share=data.split(",");
if (share.length>=1){
for(var i = 0; i < share.length; i++)
{
var dynlist = dynlist + ('<li><form id="'+share[i]+'" method="POST" action="Next.php" data-ajax="false">'+
'<input id="id" name="id" value="'+share[i]+'" type="hidden"/> </form>'+
'<img src="images/pic.png" class="img'+share[i]+'" align="LEFT" width="38" height="38" />'+
'<a onclick="document.getElementById('+share[i]+').submit();" data-transition="slide" data-ajax="false"> '+share[i]+'</a></li>');
}
return document.innerHTML(dynlist);
} else {
var dynlist = ('<li> <a data-rel="back" data-role="button" data-icon="back" data-ajax="false">No results, click to get back </a></li>');
return document.innerHTML(dynlist);
}
});
});
</script></div></body></html>
I also tried it with document.write (same result like innerHTML) and some other versions like document.write with every single line .... No positive results ... please help :) Thanks!
EDIT: I get the correct code that I want but it don´t show me the result i want... (the link is not working for example and there is no jQuery in the list ...)