页面自动执行的几种方法 (加载)js的几种方法 原生和jquery

来源:互联网 发布:java double转float 编辑:程序博客网 时间:2024/06/04 01:15

原生js

window.onload=function(){     //写具体的逻辑代码}

Jquery

方法1$(function($) {    alert({{$work_location}});    $('#profile_location').val( {{$work_location}} );    $('#profile_sublocation').val({{$work_sublocation}});    $('#height').val({{$height}});});**OR**

$(document).ready(function() {
});

方法2$(function() {   alert({{$work_location}});    $('#profile_location').val( {{$work_location}} );    $('#profile_sublocation').val({{$work_sublocation}});    $('#height').val({{$height}});});
阅读全文
0 0
原创粉丝点击