使用隐藏的模板并获取错误404 [英] Using hidden template and getting the Error 404

查看:210
本文介绍了使用隐藏的模板并获取错误404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是JsViews的新手...我使用了 http://www.jsviews.com/#jsrplaying 方法来创建我的模板.但不是将我的模板添加到内,而是添加了隐藏的.现在,对于隐藏的模板,我得到了"NetworkError:404 Not Found-//%7B%7B:URL%7D%7D?new = {{:: magicNumber}}",它与URL源有关,因为它不是隐藏模板中存在.... {{:URL} ... umber}}我只是想知道如何从控制台(检查元素)中获取此错误

I'm new to JsViews... I used http://www.jsviews.com/#jsrplaying method to create my template. but instead of adding my template inside the I've added in the hidden . Now for the hidden template I'm getting the "NetworkError: 404 Not Found - //%7B%7B:URL%7D%7D?new={{:magicNumber}}" which is related to the URL source as it is not exist in hidden template .... {{:URL}...umber}} I'm just wondering how I can get of this error from the console (inspect element)

推荐答案

在隐藏的div中而不是脚本块中声明模板不是一个好主意.如果模板包含诸如<img src="{{:...}}" />之类的内容.然后浏览器将尝试从不存在的URL加载img.在脚本块中,标记仅被视为文本-因此避免了诸如此类的副作用.

Declaring a template in a hidden div rather than a script block is not a good idea. If the template includes things like <img src="{{:...}}" />. then the browser will try to load the img from a non-existant URL. In a script block, the markup is just treated as text - so avoids side-effects like that.

这篇关于使用隐藏的模板并获取错误404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆