html5 jquery bootstrap modal load No Jquery

Usually use jquery load url https://stackoverflow.com/questions/34503683/jquery-to-open-bootstrap-v3-modal-of-remote-url Only use html5 https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML https://stackoverflow.com/questions/17636528/how-do-i-load-an-html-page-in-a-div-using-javascript <a href="url ooxxooxx" data-toggle="modal" data-target="#myModal" onclick="myModal(this)"> click me </a> <div id="part3dviewModal" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> </div> <div class="modal-body"> <p>Loading...</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> <script> function myModal(o){ p = document.querySelector("#myModal .modal-body"); p.innerHTML = '<object type="text/html" data="' + o.href + '" ></object>'; } </script>

2020-11-19 · 1 min · 71 words · Me

php jquery multi file download

https://github.com/sjardim/processwire-simple-flickr-album http://www.webinfopedia.com/multiple-file-download-by-creating-zip-file-in-PHP.html http://stackoverflow.com/questions/1754352/download-multiple-files-as-zip-in-php ===== jquery https://github.com/biesiad/jquery-multidownload ** $(’.my_download_trigger’).multiDownload({ delay: 500 }); http://stackoverflow.com/questions/9047645/download-multiple-files-without-using-zip-file https://github.com/sindresorhus/multi-download

2015-12-07 · 1 min · 13 words · Me

jQuery Mobile and AngularJS Working Together

http://simonguest.com/2013/04/08/jquery-mobile-and-angularjs-working-together/ http://0not.net/index.php/using-angularjs-and-jquery-mobile/ At the bottom of body, load AngularJS and then jQM Use jQM for routing (which is the default, as long as you don’t include ngRoute)

2014-09-21 · 1 min · 27 words · Me

[轉]jQuery file upload maxNumberOfFiles options--無用

http://stackoverflow.com/questions/16723877/jquery-file-upload-maxnumberoffiles-and-getnumberoffiles-options I believe getNumberOfFiles was only added as an option to a recent version of jquery.fileupload-ui.js (8.2.1). As an alternative, you can set the option singleFileUploads to false, and in the add callback you can throw errors if more than one file is added. var maxFiles = 1; $('#fileupload').fileupload({ singleFileUploads: false, url: '/uploadUrl' }).bind('fileuploadadd', function (e, data) { var fileCount = data.files.length; if (fileCount > maxFiles) { alert("The max number of files is "+maxFiles); return false; } });

2014-08-18 · 1 min · 78 words · Me

[轉]jquery file upload 改檔名

https://github.com/blueimp/jQuery-File-Upload/issues/622 看連結最下面 Here is some updated code that works with the most recent version as of July 18, 2014. class CustomUploadHandler extends UploadHandler { /* Converts a filename into a randomized file name */ private function _generateRandomFileName($name) { $ext = pathinfo($name, PATHINFO_EXTENSION); return md5(uniqid(rand(), true)).'.'.$ext; } /* Overrides original functionality */ protected function trim_file_name($file_path, $name, $size, $type, $error, $index, $content_range) { $name = parent::trim_file_name($file_path, $name, $size, $type, $error, $index, $content_range); return $this->_generateRandomFileName($name); } } $upload_handler = new CustomUploadHandler();

2014-08-16 · 1 min · 78 words · Me

datatable row_id

基本上官方的fnGetData和fnGetPosition之類,fnGetPosition拿到是抓出幾筆中第幾筆id和真正的Row_ID不一樣。用fnGetData一直拿到Object,根本解不開,試了官方和網路上的方式,全都不行。 fnrender被拿掉了…..無法判斷Object 最快方式:直接用jquery $(’#datatable tbody’).on( ‘click’, ’tr’, function () { 這行會取得tr 底下直接用 row_id = $(this).attr(‘id’).split("_")[1]; $(this).attr(‘id’)會找到tr用的id,得到值:ROW_22 split("_")之後:ROW 22,取[1],就行得到id。

2014-08-13 · 1 min · 18 words · Me

jquery live bind在click

確實搞錯使用方式 正確來說,用id時,如果要多個相同,可能只會綁定第一個 所以最好用 class或是html元素(p href…)之類才能綁住 另外綁住之後,取值要記得用$(this),這樣才會取到 執行綁定的元件 重要:live新版停用,請用on ….這是試了很久才發現,為什麼javascriprt一直錯,才發現沒live這function,才知道新版刪除function,請用on 或bind ========================= element.click 如果有新增或變更element會失敗 $("#pic_del").click bind比較沒什麼問題,但也有可能 $("#pic_del").bind(‘click’, function() { http://stackoverflow.com/questions/7268580/bind-click-and-live-click live是最好,但不能直接 #pic_del是a href,所以 $("#pic_del").live(‘click’, function() { 會失敗 按連結說明,要找到對應的selector再指定 也許 $("#xxx a").live(‘click’, function() { 但實際上…用bind比較快,live會失效…..也許是我搞錯或用錯方式 DOM traversal methods are not supported for finding elements to send to .live(). Rather, the .live() method should always be called directly after a selector

2014-08-12 · 1 min · 58 words · Me

jquery file upload 官方範列很爛

官方: https://github.com/blueimp/jQuery-File-Upload/wiki/PHP-MySQL-database-integration 少一大堆東西,根本看不懂…真的看了兩次,砍了一次放棄… 重點1: form的用法是把 < input type=“file” name=“files[]” multiple > 這行放到 form中,記得form要有id,而input裡面id拿掉 另一種方式:是在 $(function () { $(’#fileupload’).fileupload({ 這裡面補上 formData: {example: ’test'} 看了很多很多範列的….的結論,所以form不用button來submit,要用button來做,請看範例了。 重點2:在上傳的.php中,記得 bind_param(‘sisss’, 這個奇怪的東西是對應你傳參數的型能,傳兩個參數是字串,那個只要ss就行了! 還有如果要測試直接設值,請$a=“xxx”,因為reference,要給變數,不能直接設值。 http://runnable.com/UZKDAYo3XEw2AACX/how-to-upload-a-file-using-jquery-for-php 這個是過期很久的範列….不適合 現在的版本 底下這個範列簡單多了,看得懂 http://kyokasuigetsu25.wordpress.com/2011/03/29/multiple-file-upload-using-jquery-and-php/ ================================== 真心話:如果不堅持,用下面這個可能會比較快,因為下面這個寫的最完整直接,可以控制…. http://www.phpgang.com/how-to-upload-multiple-images-jquery-ajax-using-php_453.html

2014-08-12 · 1 min · 35 words · Me

jquery datatables 大推

當然有幫忙的,現在真的更好了… http://www.datatables.net/ 現在也有編輯,更狠的是,把資料打一打,全都建好了… https://editor.datatables.net/generator/index

2014-08-09 · 1 min · 4 words · Me