0

I have an HTML code with the following:

<object class="sis" id="sis1" type="text/html" data="sis/sis1.html"></object>

and in the imported file I have and <h2> I am trying to manipulate with JS, but I can figure out a way to select the element.

I've even tried: document.getElementById("sis1").getElementById("h2_id") but -> Uncaught TypeError: Object #<HTMLObjectElement> has no method 'getElementById'


You want to use let.

(let ( (name value)
       (othername othervalue))
  expression-using-name)

So

(define (map-it n)
  (let ((filt (lambda (l)
                 (filter number? l)))
        (mpan (lambda (b)
                 (map add1 b))))
     (mapit map list n)))

But what are you trying to accomplish here? You're not actually using mapn or filt anywhere.

I think you can just use

(define (mapl n)
  (define (filt n)
    (filter number? n))

  (define (mapn n)
   (map add1 (filt n)))

  (map list (mapn n)))

Since scheme allows nested definitions.

4

1 回答 1

1

你试过吗?

document.getElementById('sis1').contentDocument.getElementById('h2_id');
于 2013-11-10T18:32:26.977 回答