473,802 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

can we fetch the comma separated values of dcsMultiTrack in HTML page

10 New Member
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">dcsMultiTrack('DCS.dcsuri','/a/b/c/d/e','DCS.dcsqry','_ABC=ABC_0001','DCSext.error_code','abc500','DCSext.error_desc','FAILURE','DCSext.error_type','ABC Error','DCSext.RegType','ABC Registration','DCSext.RegStep','ABC Entry');</script>
Suppose, there is a script with dcsMultiTrack method with its comma seperated values in the HTML page (as shown above).

Is it possible to fetch each of these comma seperated using JavaScript function at page load? Can someone please help me out and share the code snippet for the same.

Thanks in Advance!
Jul 17 '10 #1
5 2691
gits
5,390 Recognized Expert Moderator Expert
so the parameters of that tracking function are always different? is that script added to the page automatically without having control over it?
Jul 19 '10 #2
amkohl
10 New Member
@gits
Yes, it will be different for different scenarios. Here, our main concern is to first traverse the page and check if the value of 'DCS.dcsqry' is '_ABC=ABC_0001' . If yes, then we will stor this value in a variable for analysis.

Secondly,this script is added through a code within <body> tag and yes, we do not have control over it.

I hope this answers all your queries.

Appreciate your help!
Thanks!
Jul 19 '10 #3
gits
5,390 Recognized Expert Moderator Expert
here is an example for what you might do:

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. // dummy function for test - we need a declared one
  3. function dcsMultiTrack() {
  4. }
  5.  
  6. function getDcsMultiTrackParams() {
  7.     var scripts = document.getElementsByTagName('script');
  8.  
  9.     for (var i = 0; n = scripts[i]; ++i) {
  10.         var jsCode = n.innerHTML;
  11.  
  12.         if (/^dcsMultiTrack\(/.test(jsCode)) {
  13.             var paramsString = jsCode.match(/[^dcsMultiTrack\(]([^)]+)/)[0];
  14.             var paramsArray  = paramsString.split(',');
  15.  
  16.             alert(paramsArray);
  17.         }
  18.     }
  19. }
  20.  
  21. </script>
  22. <script type="text/javascript">dcsMultiTrack('DCS.dcsuri','/a/b/c/d/e','DCS.dcsqry','_ABC=ABC_0001','DCSext.error_code','abc500','DCSext.error_desc','FAILURE','DCSext.error_type','ABC Error','DCSext.RegType','ABC Registration','DCSext.RegStep','ABC Entry');</script>
  23.  
  24. <body onload="getDcsMultiTrackParams();">
  25. </body>
  26.  
it alerts the extracted params array that are passed to the dcsMultiTrack-method.
Jul 19 '10 #4
amkohl
10 New Member
@gits
Many Thanks for the help!

As I mentioned earlier, we DO NOT have access to the HTML page in which this below script is embedded.So, this JS method and body onload function is not possible.

Possibly,can we try it by using some external JS to fetch these comma separated values within the HTML?

Note - We have a framework through which we can add an external JS to the same HTML at page load.

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">dcsMultiTrack('DCS.dcsuri','/a/b/c/d/e','DCS.dcsqry','_ABC=ABC_0001','DCSext.error_code','abc500','DCSext.error_desc','FAILURE','DCSext.error_type','ABC Error','DCSext.RegType','ABC Registration','DCSext.RegStep','ABC Entry');</script>
Jul 20 '10 #5
gits
5,390 Recognized Expert Moderator Expert
if the page is on another domain then it is not possible due to the same origin policy ... if not you might retrieve it the same way as i showed you from another frame by refering everything to the corresponding frame ...

if there are no frames then you could add an external script and you would need to extend the onload-handler in it to call the retrieve-script in that external script ...
Jul 20 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1779
by: RogerTBrick | last post by:
Cheers for the help last time guys. Again this is probably dead simple but try as I might, I just can't work it out. THe XML file I am being give contains some code value that need to be exchanged for text in the final output (to HTML as it happens). <root> <thingy code="2"/> <root> My first solution (the one I thought would be easiest) was you use two
1
33950
by: idog | last post by:
If I start off with a string which contains comma separated ints. I want to move this into an int array so i can do sorting. I thought I might get this to work: int test = {textBox1.Text}; What would be the best way to accomplish this? This is what i came up with:
2
3784
by: RD | last post by:
S= myTxtStrean.Readline gives me a string. How do I extract the fields separated by commas for instance 1,123456,345632,7876543 1,234567890,5432,87654 (values are not each the same length) Thanks for any help Bob
3
29604
by: mahe23 | last post by:
All, How do One convert a comma separated column from a text file into rows in oracle. I have a scenario where the list of comma separated values changes dynamically. It is like: abc, ttt, 1,2,34,56,67,, afg, ttt, 3,4,5,6,,,,,
3
3203
by: shark | last post by:
Hi All, i hv created a sp as Create proc P @iClientid varchar (100) as Begin select * from clients where CONVERT(VACHAR(100),iClientid) in( @iclientid)
1
5355
by: alister joseph | last post by:
hi I have two tables, i have to combine them & a column should contain comma separated value. example 1 a 2 b 2 c 2 d 3 a
1
2134
by: shaji66 | last post by:
how to update values in HTML page using java script: hi all , I want to update some text fields in html , and display these values in another page .... can you please help me in writing java script can you please post code for it or give me perticular sites that can help me... thank you in advance...
4
7716
by: flavourofbru | last post by:
Hi, In the datagridview control, one of my column has multiple values separated by a comma Is there a way to get individaual values which are separated by a comma from that particular cells? Thanks in advance, Brugu
10
2021
by: Tony Johansson | last post by:
Hello! What does it mean when it says that there is no information about the data types of the data extracted from a CSV file. Can somebody this. //Tony
3
2601
by: anil2083 | last post by:
How to migrate the comma separated values from one table to another table? suppose we have table i.e XYZ and we have comma separated values in few columns i.e( column_name and values are A,B,C,D).Now i have to migrate these comma separated values into new table i.e PQR. Example: Table1 column_name1 complexion values : VF,F,AVG etc.. column_name2 profession values : TEA,LECT etc...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10538
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10305
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.