Wassim Al Ahmad
Wassim Al Ahmad

Reputation: 1094

Select an item or link

Sometimes this script does not work, I am using it in a php file

    <script type="text/javascript">
        window.onload = function () {
          var input = document.body.getElementById("thisActive");
          input.focus();
          input.select();
        }
    </script>

here is work http://cartoon.22web.org/watch/s-watch/index.php

After the page load is complete, the script specifies the link to the page ===========================

But here using multiple pages http://wassim-al-ahmad.22web.org

not selected page selected

Upvotes: 1

Views: 159

Answers (4)

samo
samo

Reputation: 34

i had the same problems just you have to change your host if you used free host you must change the host to

Upvotes: 1

mario
mario

Reputation: 21

Use PHP to view the data from the database starting with the page order currently displayed. You do not need to use the script you have ever typed in your HTML code.

Upvotes: 2

mohanad al
mohanad al

Reputation: 21

You have seen the code and the reason for the priority You are using JavaScript at the beginning of the code and then create a menu to select an item from a database using PHP multiple pages You must use the script at the end of the code

Upvotes: 2

Saeid Amini
Saeid Amini

Reputation: 1307

Just convert window to document like this:

document.onload = function () {
    var input = document.body.getElementById("thisActive");
    input.focus();
    input.select();
}

JQuery version

$(document).ready(function () {
    ...
});

Upvotes: 2

Related Questions