0
爲了避免使用全局變量,我試圖將數據設置到類中並將其讀回來。 但結果我得到回來爲[Object , Object]
,當我試圖字符串化的是我得到的{}
如何將數據設置爲課程並將其讀回來?
http://jsfiddle.net/oeufafed/2/
這是我的代碼
<div id="section">
<form class="myformcalss">
London is the capital city of England. It is the most populous city in the United Kingdom
</form>
</div>
$('#section').find('.myformcalss').data('sample data');
var text = $('#section').find('.myformcalss').data();
//var result = JSON.stringify(text);
alert(text);
可否請你讓我知道如何設置和讀取數據?
非常感謝你非常。 – Kiran 2015-02-11 12:30:08