记录 js拼接url 比如有些时候我们需要为某按钮实现跳转,可以利用下面的方式做到: function ReturnIndex() { var rex = RegExp("tools") var url = window.location.origin var new_url = "http://127.0.0.1:"+window.location.port if (url.match(rex)) { curr_url = window.location.orig
今天在操作一个元素时,id值是拼接的. var index = $(this).attr(‘index’); //0var id = ‘#’ + (index+1); //#01$(id).attr(‘style’,”); 正确处理:parseInt函数 var index = parseInt($(this).attr(‘index’)); //0var id = ‘#’ + (index+1); //#1$(id).attr(‘style’,”);
function Ajax_GetCourseAndResource(data) { $(".ol-course-list").empty(); var html = ""; var len = data.Data.length; for (var i = 0; i < len; i++) { var len2 = data.Data[i].Resourceses.length; html += ' <div class="ol-course-
<html> <head> <title>test page</title> <script type='text/javascript'> <!-- function createTable() { var t = document.createElement('table'); for (var i = 0; i < 2000; i++) { var r = t.insertRow(); for (var j = 0; j <