About Require.js introduced layer.js after the layer.css and other style files can not be introduced to solve

Source: Internet
Author: User

We need to use the Layer.js Layer.config method here.  
That
Layer.config ({        path: ' {garcia_js}layer/'//layer.js directory, which can be either an absolute directory or a relative directory         });

The detailed code is as follows

Require ([' {garcia_js}layer/layer.js '],function(layer) {Layer.config ({path:' {garcia_js}layer/'//the directory where the Layer.js is located, either an absolute directory or a relative directory    }); $ (document). On (' Click ', ' #checkButton ',function(){        varcode=$ ("Input[name= ' Checkcode ')"). Val (); if($ ("Input[name= ' Checkcode ')"). val () = = ") {layer.msg (' Please enter verification code ', {icon:7, Time:2000//2 seconds Off (default is 3 seconds if not configured)            }); return false; } $.ajax ({URL:"{php echo $this->createweburl (' Yongjin ', Array (' Display ' = ' Search_order ')}", type:' Post ', DataType:' JSON ', data:{checkcode:$ ("Input[name= ' Checkcode ')"). Val ()}, Success:function(ret) {if(ret.errorcode==0) {layer.prompt ({formtype:3, Value:$.trim (code), title:' Please confirm the verification code ',                    }, function(value, index, elem) {$.ajax ({URL:"{php echo $this->createweburl (' Yongjin ', Array (' Display ' = ' change_status ')}", type:' Post ', DataType:' JSON ', data:{Checkcode:value}, Success:function(res) {if(res.errorcode==0{layer.msg (res.msg, {icon:1, Time:2000//2 seconds Off (default is 3 seconds if not configured)                                    }); Location.reload ()}Else{layer.msg (res.msg, {icon:7, Time:2000//2 seconds Off (default is 3 seconds if not configured)                                    });                    }}) layer.close (index);                }); }Else if(ret.errorcode==2{layer.msg (ret.msg, {icon:7, Time:2000//2 seconds Off (default is 3 seconds if not configured)                    }); }Else{layer.msg (ret.msg, {icon:7, Time:2000//2 seconds Off (default is 3 seconds if not configured)                    });  }            }        })    }); })

About Require.js introduced layer.js after the layer.css and other style files can not be introduced to solve

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.