//dom
<div id='toBeCloned'><span>Some name</span></div>
<div id='targetElm'></div>
//js
$(function () {
//creating a clone
var _clone = $('#toBeCloned').clone(true);
// target element
var _target = $('#targetElm');
//now target element is to be filled with cloned element with data of span changed
var _someData = [1, 2, 3, 4];
//loop through data
$.each(_someData, function (i, data) {
var _newElm = {};
$.extend(_newElm, _clone);//copy cloned to new Elm
_newElm.find('span').html(data); //edit content of span
alert('p'); // alert added to show that append in next line …Run Code Online (Sandbox Code Playgroud) 我试图通过在IE8中使用$ .browser.version来获取用户使用的IE版本
当我以不同的格式写我的网址时,我得到了不同的结果
http://localhost/test.html----------this is giving result=8
http://192.168.1.2/test.html--------this is giving result= 7
http://www.something.com/test.html--this is giving result= 8
Run Code Online (Sandbox Code Playgroud)
唯一的问题是当我使用192.168.1.2,这是我的电脑的IP,我想要这种格式的网址在网络电脑上进行测试.
i dont know why there is a difference??
Run Code Online (Sandbox Code Playgroud) 我有一张像柱子一样的桌子
id || 计数器
如果我做某事(某些事件)我希望计数器的值(在特定的id)增加1,目前iam这样做:
//get current value
current_value = select counter from myTable where id='someValue'
// increase value
current_value++
//update table with current value
update myTable set counter=current_value where id='someValue';
Run Code Online (Sandbox Code Playgroud)
目前iam运行2个查询,请建议我一步到位.
class Country
{
//props
}
Run Code Online (Sandbox Code Playgroud)
dataContext是一个带有方法Set()的变量,它的工作方式如下所示
dataContext.Set<Country>().SomeThing();
Run Code Online (Sandbox Code Playgroud)
但我不想硬编码类型=国家,而是我想从变量中提取类型,例如
function MyFunction(object o)
{
dataContext.Set</*something_here*/>().SomeThing();
//some how extract type from variable o
}
Run Code Online (Sandbox Code Playgroud) 我在正则表达式中非常差,如果有人帮助这个正则表达式我会很感激
正则表达式应该匹配: - 第一个正向之前的任何文本 - 斜杠否则全文,然后是不在大括号内的文本
HELLO/anything/blah/bhah ---------> should return HELLO
{HELLO}/anything/blah/bhah -------> should not return any thing
ABC/blah/blah---------------------> should return ABC
ABC-------------------------------> should return ABC
Run Code Online (Sandbox Code Playgroud)