简体   繁体   English

如何找出哪些脚本代码和/或插件在页面上的元素内呈现外观和功能?

[英]How to find out what script code and/or plugin is rendering appearance and functionality within an element on the page?

I've found a control on another webpage that I like. 我在另一个喜欢的网页上找到了一个控件。 Assuming the site developers didn't build it from scratch, how do I determine what scripting framework and/or plugin they're using to transform and style it? 假设站点开发人员没有从头开始构建它,那么我如何确定他们使用什么脚本框架和/或插件来对其进行转换和样式设置?

It's like a selection control of sorts in "bar form". 就像“条形”中的各种选择控件一样。 It's on the realtor.com site here . 它在realtor.com网站上

在此处输入图片说明

I've gotten the class names used for the parent container and its children, but searching for occurances of those in the javascript docs using Opera's dragonfly didn't yield any matches. 我已经获得了用于父容器及其子容器的类名,但是使用Opera的Dragonfly在javascript文档中搜索它们的出现并没有产生任何匹配。 How do I find out how this is being constructed??? 我如何找出其构造方式???

There's no easy way that I know of that will tell you which code did render which elements. 据我所知,没有简单的方法可以告诉您哪个代码渲染了哪些元素。 However you can go by deduction here. 但是,您可以在这里扣除。 First of all, is the code rendered on the server or the client? 首先,代码是呈现在服务器还是客户端上? An easy way to know for sure would be to inspect the initial source of the page and check if the elements are already present. 确定的一种简单方法是检查页面的原始来源,并检查元素是否已存在。 If they are, it would mean that they were rendered server-side or they already existed in the initial static document. 如果是这样,则意味着它们是在服务器端呈现的,或者它们已经存在于初始静态文档中。

As far as I can tell, the search bar markup doesn't seem to be generated client-side. 据我所知,搜索栏标记似乎不是在客户端生成的。

However, behaviour is certainly added client-side. 但是,行为肯定是在客户端添加的。 I went through the code and from what I can tell they seem to be using a library that's also used on http://www.move.com/ 我遍历了代码,据我所知,它们似乎使用的是http://www.move.com/上的库

The scripts of interest would be: 感兴趣的脚本为:

http://static.move.com/getstatic/getfile.ashx?chl=rdc&typ=js&vr=7.2.0.2340&fls=core/jquery/jquery-1.7.1.min,core/jquery/jquery.cookie.min,core/jquery/jquery.validate.min,core/jquery/jquery.json-1.3,core/jquery/jquery.ba-hashchange,core/legacy/legacy-move,core/legacy/movedialog.min,core/namespace,core/utils/underscore-min,core/utils/storage-util,core/movecore,core/cookie/cookies,core/tracking/edwtracking,core/tracking/clientevents,core/tracking/dwgtracking,core/tracking/omnituretracking,core/tracking/comscoretracking,map/hashmapping,core/utils/hash-util,core/utils/support,core/utils/captcha-util,s_code,seo/_seoparagraphs,core/ui/bootstrap http://static.move.com/getstatic/getfile.ashx?chl=rdc&typ=js&vr=7.2.0.2340&fls=core/jquery/jquery-1.7.1.min,core/jquery/jquery.cookie.min,core /jquery/jquery.validate.min,core/jquery/jquery.json-1.3,core/jquery/jquery.ba-hashchange,core/legacy/legacy-move,core/legacy/movedialog.min,core/namespace,core / utils / underscore-min,core / utils / storage-util,core / movecore,core / cookie / cookies,core / tracking / edwtracking,core / tracking / clientevents,core / tracking / dwgtracking,core / tracking / omnituretracking,core / tracking / comscoretracking,地图/哈希映射,core / utils / hash-util,core / utils / support,core / utils / captcha-util,s_code,seo / _seoparagraphs,core / ui / bootstrap

http://static.move.com/getstatic/getfile.ashx?chl=rdc&typ=js&vr=7.2.0.2340&fls=nopaindoubleload4v6,core/utils/jquery.dropkick-1.0.0,search/searchview/_topsearchview,geography/didyoumean/_didyoumean,modal/_modalview,search/_propertysearchcore,search/_partialviewcontainer,core/ui/bootstrappopovertooltip,core/utils/fb_connect_util,core/utils/rc4encrypt,registration/_registrationwidget,core/ui/slider,search/facets/_facetconcepta,geography/_predictivetext,core/ui/bootstraptabs,map/mapview/_mapview,map/map,search/listview/_resultscount,core/ui/bootstrap,search/featuredhomes/_featuredhomes,search/listview/_listviewsort,core/ui/_loadingindicator,search/listview/_listview,admedia/_admedia,search/listview/_resultsperpage,fcma/_fcma,propertydetail/_freemovingquotehandler,propertydetail/leadforms/_leadmodels,core/ui/datepickr,propertydetail/_movingcalculator,search/_trackpageview,search/_tracksearch,registration/_rdcmyitemswidget,admedia/_trackingpixel,instruments,pagetophat/_pagetophat,admedia/_a http://static.move.com/getstatic/getfile.ashx?chl=rdc&typ=js&vr=7.2.0.2340&fls=nopaindoubleload4v6,core/utils/jquery.dropkick-1.0.0,search/searchview/_topsearchview,geography/didyoumean / _didyoumean,模态/ _modalview,搜索/ _propertysearchcore,搜索/ _partialview容器,core / ui / bootstrappopovertooltip,core / utils / fb_connect_util,core / utils / rc4encrypt,注册/ _registrationwidget,core / ui / slider,search / facets / _ography概念/ _predictivetext,core / ui / bootstraptabs,map / mapview / _mapview,map / map,search / listview / _resultscount,core / ui / bootstrap,search / featuredhomes / _featuredhomes,search / listview / _listviewsort,core / ui / _loadingindicator,搜索/ listview / _listview,admedia / _admedia,搜索/ listview / _resultsperpage,fcma / _fcma,属性详细信息/ _freemovingquotehandler,属性详细信息/ leadforms / _leadmodels,核心/ ui / datepickr,属性详细信息/ _movingcalculator,搜索/ _trackpageyregistration,搜索/ ,admedia / _trackingpixel,仪器,pagetophat / _pagetophat,admedia / _a dmediamanagercore,breadcrumb/_breadcrumb,contentmanagement/_linkingmodule dmediamanagercore,面包屑/ _breadcrumb,内容管理/ _linkingmodule

They seem to be passing module names to the getfile.ashx page. 他们似乎正在将模块名称传递给getfile.ashx页面。 You could probably eliminate the modules that seems useless for what you are looking for, which would make the code analysis easier. 您可能会消除似乎对您所寻找的东西无用的模块,这将使代码分析更加容易。

Once you retrieved the sources, you can use http://jsbeautifier.org/ to format the code. 检索源之后,可以使用http://jsbeautifier.org/设置代码格式。

Have a look at everything namespaced in MoveCore and MoveLib . 看一下MoveCoreMoveLib命名空间的MoveCore MoveLib The library seems to be broken down by modules, where the page would register the modules it needs with MoveCore.Tracking.addService . 该库似乎已被模块分解,该页面将通过MoveCore.Tracking.addService注册所需的模块。

Please note that I doubt it's actually legal to "steal" the code and I would strongly advise you to roll your own solution instead. 请注意,我怀疑“窃取”代码是否合法,我强烈建议您改用自己的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM