var testvar = "something";
//only one of the following 3 lines were uncommented while testing:
var myinsert = '<span class="green myCursor"
onClick="getproblemsadmin(testvar)">
Test
</span>'; //doesn't pass testvar to function
var myinsert = '<span class="green myCursor"
onClick="getproblemsadmin(\'testvar\')">
Test
</span>'; //doesn't pass testvar to function
var myinsert = "<span class='green myCursor'
onClick='getproblemsadmin(\"testvar\")\'>
Test
</span>"; //doesn't pass testvar to function
$('.someclass').html(myinsert); //jquery works and this works (tested)
有没有办法将变量传递给这样的函数?