Results 1 to 6 of 6

Thread: [HTML]Javascript][JQuiry?]Is it possible?

  1. #1
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default [HTML]Javascript][JQuiry?]Is it possible?

    Is it possible to access information from site A from a script on site B on the same computer.

    Example: I need to retrieve the name of someone in Site A,

    It appears to be stored in this code

    Code:
    <span style="width: 1px"><input id="incident.caller_id" class="direction:ltr" type="hidden" onchange="onChange('incident.caller_id')" name="incident.caller_id" value="cac2822e4cc8a500fbf04c45b7ae6e38"><input id="sys_display.original.incident.caller_id" type="hidden" name="sys_display.original.incident.caller_id" value="THIS IS WHERE THE NAME IS">
    Can I retrieve that info from site B somehow?
    Last edited by JPHamlett; 01-18-2015 at 05:57 AM. Reason: Fixed [CODE] tag

  2. #2
    Join Date
    Nov 2014
    Posts
    104
    Mentioned
    12 Post(s)
    Quoted
    59 Post(s)

    Default

    Since it sounds like you own both the sites, you can use CORS to make cross domain requests. Here is a pretty decent tutorial that will help you set it up. Feel free to send me a PM if you have any more questions.

  3. #3
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default

    Retrieve the page with jQuery and parse the HTML to get the value?
    $.get
    $.ajax

    Script source code available here: Github

  4. #4
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by J J View Post
    Retrieve the page with jQuery and parse the HTML to get the value?
    $.get
    $.ajax
    The issue is that the URL does not change. The name seems to be stored in a javascript applet(not sure about the terminology). Can I grab the fields of javascript?

    I can pull the code up when I right click and select inspect element on Chrome.

    Fairly similar to old school reflection.
    Last edited by JPHamlett; 01-19-2015 at 01:01 AM.

  5. #5
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default

    Quote Originally Posted by JPHamlett View Post
    The issue is that the URL does not change. The name seems to be stored in a javascript applet(not sure about the terminology). Can I grab the fields of javascript?

    I can pull the code up when I right click and select inspect element on Chrome.

    Fairly similar to old school reflection.
    If Chrome can show it then you can grab the value.
    With the help of http://api.jquery.com/jquery.parsehtml/ or a different library it is certainly possible to grab the fields.

    Script source code available here: Github

  6. #6
    Join Date
    Feb 2007
    Location
    Colorado, USA
    Posts
    3,716
    Mentioned
    51 Post(s)
    Quoted
    624 Post(s)

    Default

    as said, CORS
    assuming you own both sites. cross domain security complaints / issues have been around for a long time
    other than that you'd need some naughty hacks to have the client get the page in the background & parse through it is probably the easiest part.. or use php/something else to


    assuming it is your site access_control_allow_origin header should be '*' for all or 'whatever site name is' for CORS

    parsing shouldn't be your biggest issue.. and you shouldn't be using all of jquery to do so

    HTML Code:
    <span style="width: 1px">
    <input id="incident.caller_id" class="direction:ltr" type="hidden" onchange="onChange('incident.caller_id')" name="incident.caller_id" value="cac2822e4cc8a500fbf04c45b7ae6e38">
    <input id="sys_display.original.incident.caller_id" type="hidden" name="sys_display.original.incident.caller_id" value="THIS IS WHERE THE NAME IS">
    
    <script>
    
    var wut = document.getElementById('sys_display.original.incident.caller_id').value;
    console.log(wut);
    </script>
    The only true authority stems from knowledge, not from position.

    You can contact me via matrix protocol: @grats:grats.win or you can email me at the same domain, any user/email address.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •