Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

How to create bookmarks with javascript?

$
0
0

Hello!

 

I have a question regarding the creation of boomarks with javascript.

I'm using the following line to create bookmarks:

     this.bookmarkRoot.createChild(words[i], "pageNum=a");


The problem is that the bookmarks are created but all lead to the same page.

 

The full code:

 

/ Put script title here /

var string2 = [];

string2 = "word;example;test";

var words = words.split(";");

var N = words.length;

 

for (i = 0; i < N; i++) {

    var pageArray = [];

    var string = words[i];

    for (var p = 0; p < this.numPages; p++) {

        for (var n = 0; n < this.getPageNumWords(p); n++) {

            if (this.getPageNthWord(p, n) == words[i]) {

                pageArray.push(p);

                a = pageArray[0];

                this.bookmarkRoot.createChild(words[i], "pageNum=a");

                break;

            }

        }

    }

}

 

Any help is much appreciated!


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>