lib/jx/js.rb
def load(filename)

      file = caller.first.split(/:\d/,2).first
      dir = File.dirname(File.expand_path(file))
      
      scrpt = "" 
      begin
        file = File.new("#{dir}/#{filename}", "r") 
        while (line = file.gets)
          scrpt << line
        end
        file.close
      rescue => err
        puts "Exception: #{err}"
        err
      end

      @browser.executeJavaScriptAndReturnValue(scrpt)
      
    end
#------------------------------------------------------------------------------------
# Loads a javascript file relative to the callers directory
#------------------------------------------------------------------------------------
Loads a javascript file relative to the callers directory
Loads a javascript file relative to the callers directory
def load(filename)
      file = caller.first.split(/:\d/,2).first
      dir = File.dirname(File.expand_path(file))
      scrpt = "" 
      begin
        file = File.new("#{dir}/#{filename}", "r") 
        while (line = file.gets)
          scrpt << line
        end
        file.close
      rescue => err
        puts "Exception: #{err}"
        err
      end
      @browser.executeJavaScriptAndReturnValue(scrpt)
    end
def load ( filename ) file = caller . first . split ( / : \d / , 2 ) . first dir = File . dirname ( File . expand_path ( file ) ) scrpt = "" begin file = File . new ( "#{dir}/#{filename}" , "r" ) while ( line = file . gets ) scrpt << line end file . close rescue => err puts "Exception: #{err}" err end @browser . executeJavaScriptAndReturnValue ( scrpt ) end
Loads a javascript file relative to the callers directory
Loads a javascript file relative to the callers directory
filename