Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,297
    Thanks
    10
    Thanked 584 Times in 565 Posts
    Quote Originally Posted by felgall View Post
    You can't use globals or any variables defined elsewhere when you use eval either unless you identify that you are using antiquated rather than current JavaScript by omitting the "use strict"; statement
    if you want to use strict, then it gets uglier, but i think loading loading gloabls via url is often needed, jquery plugins for example want self.$.



    Code:
    document.body.appendChild( document.createElement( 'script' ) ).src=
       'data:text/javascript,'+
       encodeURIComponent( ' "use strict"; alert( "lucas" ) ' );
    as an aside, i hardly think strict is somehow favored over normal js, or that full js is antiquated in any fashion by the opt-in strict subset validation...
    Last edited by rnd me; 06-28-2013 at 05:53 AM.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%

  2. #17
    New Coder
    Join Date
    Jun 2013
    Posts
    22
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I think that you all didn't understand ... but i will try to explain better and with code ...
    okk soo i'm using c# (bho) to inject the code but i can't inject code directly , i inject elements ... soo the elements need to tigger by ther own ( calling himself ) to run because i can't manipulate the webpage to execute the script .... And it's worst than that ... the webpage is just compost by frames and frameset but that i can fix ... i just need to create the element ...


    The function

    Code:
    (
    
    function () {
      var nova = document.getElementById('PartNumberTextBox');
      var so = document.getElementById('so_id');
      var newsn = document.getElementById('new_sn');
      var button = document.getElementById('book_button');
      var newpart = document.getElementById('new_part_no');
      document.body.onkeyup = function (e) {
      if (e === null) e = window.event;
      var code = e.keyCode || e.which;
      if (code == '9') {
      if (e.srcElement == newsn) {
      so.focus();
      } else if (e.srcElement == so) {
      button.focus();
      } else {
      nova.focus();
      }
      }
      };
    
      nova.onchange = novafunc;
      nova.onblur = novafunc;
      nova.onkeyup = novafunc;
      nova.onmouseup = novafunc;
    
      function novafunc() {
      if (newpart.value === nova.value && nova.value.length > 0) {
      nova.style.backgroundColor = '#0f0';
      newsn.focus();
      } else {
      nova.style.backgroundColor = '#f00';
      }
      }
    
    })();
    And this script needs to be executed in IE 7
    Last edited by Lucas Azevedo; 06-28-2013 at 11:59 AM.

  3. #18
    New Coder
    Join Date
    Jun 2013
    Posts
    22
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Anyone ?
    Last edited by Lucas Azevedo; 07-01-2013 at 09:12 AM.


 
Page 2 of 2 FirstFirst 12

Posting Permissions

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