如何使用javascript检查字符串包含www prepend与http:// [英] how to check a string contains www prepend with http:// using javascript

查看:61
本文介绍了如何使用javascript检查字符串包含www prepend与http://的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

..在一个要求中,我有一个html输入文字,要求用户输入网址...这里的用户可以输入他的网址,如 http://www.domain.com 那很好..但是如果用户只输入 domain.com ....会发生什么?这里我的代码需要为给定的文本添加 http:// www 在html输入...所以我只是想检查输入文本中的网址是否包含 http:// www ...如果没有...?我的代码需要添加这个原型( http:// wwww )...任何建议或建议.....我非常乐意休息.......... .. :) ... :):...)

..In a requirement i have a html input text for asking the user to enter url...what the thing here is user may enter his url with like http://www.domain.com that's fine..but what happens if user just enters domain.com....?here my code need to add http://www for the given text in html input...so i just want to check whether an url in input text contains http://www or not...if no...? my code need's to add this prototype(http://wwww)...any suggestions or advices.....i am very much happy to fallow............:)...:)...:)

推荐答案

您已经在如何检查网址是否包含Http:// [ ^ ]。请不要重新发布相同的问题,编辑原文。
You already received a suggestion to this question at How Do I Check Whether An Url Consists Of Http://[^]. Please do not repost the same question, edit the original.


这篇关于如何使用javascript检查字符串包含www prepend与http://的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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