本文介绍了VBScript到Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SO是我在excel中能够完成的工作的简短版本.我所做的是要收集某些字段并将其存储到变量中.将打开一个网页,然后输入字段.在这种情况下,输入的主要是地址搜索.它将单击搜索,然后再次单击以在此页面上显示GIS地图.


SO below is the short version of what I was able to do in excel. What I did was had certain fields be collected and stored into variables. A webpage would open up and enter the fields. In this case it was mostly address search it was entering. It would click the search, and then click again to bring up the GIS map on this page.


If CellAssessor = "pinalassessor" Then
    SiteLink = "http://pinalcountyaz.gov/Departments/Assessor/Pages/ParcelInfoSearch.aspx"
    TextboxNumberID = "ctl00$m$g_f1ed9e0e_852a_4270_8b23_90651396ae13$ctl00$ctl02$txt_Number"
    TextboxDirectionID = "ctl00$m$g_f1ed9e0e_852a_4270_8b23_90651396ae13$ctl00$ctl02$ddl_Direction"
    TextboxNameID = "ctl00$m$g_f1ed9e0e_852a_4270_8b23_90651396ae13$ctl00$ctl02$txt_Name"
    TextboxSuffixID = "ctl00$m$g_f1ed9e0e_852a_4270_8b23_90651396ae13$ctl00$ctl02$ddl_Suffix"

    ie.navigate SiteLink
    ie.Visible = True
    Application.Wait Now + TimeValue("00:00:2")
    While ie.Busy
    DoEvents
    Wend
    ie.Document.all(TextboxNumberID).Value = Item1
    ie.Document.all(TextboxDirectionID).Value = Item2
    ie.Document.all(TextboxNameID).Value = Item3
    ie.Document.all(TextboxSuffixID).Value = Item4
End If




在excel中做到这一点可谓小菜一碟.有一次我想到了很多.现在的问题是,我想将此功能切换到CRM 2011 Microsoft Dynamics中.其中使用了JScripts.在Java语言中,我尽可能地打开了想要的URL窗口.使用:




Doing this in excel was a piece of cake. Once I figured alot of this out. Problem is now, I want to switch this feature into CRM 2011 Microsoft Dynamics. Which uses JScripts. In the Javascript I got as far as opening up the window of the URL I want. Using:

window.open("http://pinalcountyaz.gov/Departments/Assessor/Pages/ParcelInfoSearch.aspx");




但是我没有找到任何关于将地址输入字段的信息.

javascript是否支持在网页上找到对象的ID,并能够设置该值,然后在搜索中进行Webclick.在far功能中,我还希望能够知道如何在显示结果的页面上收集值.


如果有人可以帮助.这将不胜感激.如果有帮助,我可以提供整个excel vbscript.但是我基本上是将我在Vb中所做的转换为Javascript.我大部分都转换了,但这是最后一部分.




But I haven''t found anything on getting address entry into the fields.

Does javascript support finding the ID of objects on the webpage, and being able to set the value, and then doing a webclick on the search. In the far feature I would also like to be able to know how to collect values on the page that shows the results.


If anybody could help. It would be greatly appreciated. I can give the entire excel vbscript if it helps. But I''m basically converting what I did in Vb to Javascript. I got most of it converted, but this was the last part. Thx in advance.

推荐答案




这篇关于VBScript到Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 21:05