nB gUru

"Wanting to be someone else is a waste of the person you are" – Kurt Cobain

PHP to Javascript | Hyperlink Navigation

with 8 comments

Wow, another surprise, did I miss something in release notes! I hunted again and again, I think I got the treasure first :P Actually, today I was again looking into PHP support, so thought of opening my first ever PHP application, I created using Dreamweaver 8, WAMPServer (which was actually my semester project) last December.

I was going through application’s index.php, which had embedded php scripts, and links to javascripts using following tags-

<script type="text/javascript" src="styles/some_script.js"></script>

where styles/some_script.js is the script used, along with 2 more scripts. So, in body tag, there was a call to one of the functions belonging to one of the three .js files, like-

<body onload="javascript:call_func();">

So, today I was thinking, it would be nice if I click on this function, and get directed to the javascript which has this function, started visualizing it. By mistake, I pressed CTRL (Windows users) and started hovering the mouse over “javascript:call_func();” I was shocked to see it actually detected a hyperlink, I clicked and another shock, it navigated me to the exact line where the function is defined in a particular javascript.

Amazing, isn’t it? Another cool discovery ;)

What are you upto? :)

About these ads

Written by nvarun

August 19, 2008 at 3:26 pm

Posted in MySQL, NetBeans, PHP, Windows

8 Responses

Subscribe to comments with RSS.

  1. Hi,

    Opened my netbeans this morning and i saw this title – “PHP to Javascript | Hyperlink Navigation” -, so i thought of giving a look, cuz i’m looking for a php development tool. This function that you talked about, is it the NetBeans?

    Regards,
    Leo

    Leonardo Farage Freitas

    August 19, 2008 at 5:17 pm

  2. Yes, its the NetBeans :)

    You may find more information here-
    http://nbguru.wordpress.com/category/web/php-web/

    Varun

    August 19, 2008 at 5:29 pm

  3. Hi Leo,

    it depends, which version of NetBeans you have installed. The PHP functionality is available in NetBeans 6.5. You can download NetBeans PHP distribution. If you are interested in PHP features you can go through http://blogs.sun.com/netbeansphp/ , where we describe some features.

    Thanks to Varun for this nice entry.

    Regards,
    Petr

    Petr Pisl

    August 19, 2008 at 7:26 pm

  4. I’ve been doing this in Java classes for a long time and methods in Java classes would be taken to the appropriate classes. Also I think I’ve tried this in the JavaScript with a JSP page…

    Saptarshi

    August 20, 2008 at 3:01 pm

  5. @Saptarshi,

    You’re right about Java classes, I have experienced it myself and its actually great feature to be able to navigate from one file to another. Anyways, how about trying this-
    http://netbeans.dzone.com/news/revamped-html-hyperlink-naviga

    Good Luck!

    Varun

    August 20, 2008 at 3:09 pm

  6. [...] Editor Hyperlinks (PHP to Javascript) [...]

  7. [...] 03 | Editor Hyperlinks (PHP to Javascript) [...]

  8. hi, varun thanks for this special document :)

    codeboot

    February 15, 2009 at 11:43 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.