help in javascript and vba

wesley14

Board Regular
Joined
Dec 8, 2011
Messages
74
Code:
function ur_IScr_toNextPage(sId) {
  if (ur_IScr[sId].last < ur_IScr[sId].items.length - 1) {
   ur_IScr[sId].first = ur_IScr[sId].last + 1;
   ur_IScr[sId].last = - 1;
   ur_IScr_draw(sId);
  }
 }
hello I have a webpage which I need to click the next page, I tried looping through all links but the nextpage button was missing. I then download the .js file of the page and found the javascript function for it. I then tried to run it in vba but It is looking for the sId variable.. any one have any idea how to find this?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
From the code you posted, it is a passed variable so it would be defined by whatever the javascript call is in the HTML.

Try doing a search for "ur_IScr_toNextPage" in the HTML and you will likely find both the javascript call and the button.
 
Upvote 0
Are you sure it's a button that moves onto the next page?

Perhaps it's something else, eg a hyperlink.

Whatever it is it would be far easier to find it on the page and click/follow it rather than trying to execute the related javascript.
 
Upvote 0
Whatever it is it would be far easier to find it on the page and click/follow it rather than trying to execute the related javascript.


A very good point. To that end, the method I use to identify where the HTML elements are in the code is using Mozilla FireFox withe the FireBug add-in installed, you can right-click virtually any web element and select 'Inspect Element with Firebug'. It will show a HTML Editor like window with the information for the selected element highlighted.
 
Upvote 0
Ive seen the .js file and it was called from several other functions, but those functions also require some other variables e.g. function ur_RM_Scrl(sId,edgeType,oEvt)
 
Upvote 0
Ive seen the .js file and it was called from several other functions, but those functions also require some other variables e.g. function ur_RM_Scrl(sId,edgeType,oEvt)

I suspect even if we DO determine where sID comes from, it is going to be a reference to the object that is calling it (that you weren't able to find in the first place) so you are still going to be back to the start of needing to identify the calling object in the HTML portion. Hopefully, my Firebug solution can help locate the element.
 
Upvote 0
@norie, I see it as a button, but what I did was loop through all links, but all buttons where found except the ones that can control the pages. I tried using the the developer tab in IE then select element then click the button of next page, here is what I got
Code:
imgg tabIndex="0" class="urPagDummy urBtnIco urSTbvBtnPgDown" onkeydown="if (sapUrMapi_Image_checkClick('htmlb_1333_htmlb_1308_72',event)){return htmlbDoEvent(this,'S','_dflt','32','htmlb_1333_htmlb_1308',72,33,'',5,'pageDown','1','20','45','L');}" *******="if (sapUrMapi_Image_checkClick('htmlb_1333_htmlb_1308_72',event)){return htmlbDoEvent(this,'S','_dflt','32','htmlb_1333_htmlb_1308',72,33,'',5,'pageDown','1','20','45','L');}" alt="" src="/htmlb/mimes/common/1x1.gif" border="0" tp="NXTPG" ti="0"/>
 
Upvote 0
here is what I got in fire bug inspect element
Code:
img border="0" onkeydown="if (sapUrMapi_Image_checkClick('htmlb_743_htmlb_730_72',event)){return htmlbDoEvent(this,'S','_dflt','32','htmlb_743_htmlb_730',72,33,'',5,'pageDown','1','20','45','L');}" *******="if (sapUrMapi_Image_checkClick('htmlb_743_htmlb_730_72',event)){return htmlbDoEvent(this,'S','_dflt','32','htmlb_743_htmlb_730',72,33,'',5,'pageDown','1','20','45','L');}" tp="NXTPG" src="/htmlb/mimes/common/1x1.gif" ti="0" tabindex="0" class="urPagDummy urBtnIco urSTbvBtnPgDown" alt="">
 
Upvote 0

Forum statistics

Threads
1,223,632
Messages
6,173,467
Members
452,516
Latest member
archcalx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top