Link to home
Start Free TrialLog in
Avatar of Priya25
Priya25

asked on

Enabling Smart Navigation and using JavaScript Code does not work

I have enabled smart navigation for my ASP.Net web application.
It works fine except for some of my pages where I'm using some Javascript code.
Here is a sample Javascript code which I'm using

      Response.Write("<script language='javascript'>")
                Response.Write("window.open('POREP01.aspx')")
                Response.Write("</script")        
      Response.Write(">")

The error message which I'm getting is
'htmlfile:Invalid pointer'

A page http://localhost/aspnet_client/system_web/1_0_3705_352/SmartNav.js is opened in debug mode in Visual studio.Net, and it breaks at the line

            hdm.appendChild(k);
Is this a bug from Microsoft,
Pls help,
regards,
Priya
ASKER CERTIFIED SOLUTION
Avatar of roverm
roverm
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Priya25
Priya25

ASKER

Your solution works fine..thanx very much..

But now the new window is being displayed at the back of the main web page...that is it is minimised..we have to maximise it to see it...my user may not notice that the new window has been opened...
Hi priya, thanks for the points but why did you close it with a B while with a little more information it could have been an A?

The solution is to add some 'features' to the window.open:

  var sfeat='left=50,top=50,height=450,width=550,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes';
  window.open('POREP01.aspx', '_blank', sfeat);

D'Mzz!
RoverM
Avatar of Priya25

ASKER

sorry for not giving u an A..also u deserve it..its just because the solution was not 100 % complete...i mean the
window was opening at the back...I'll try what u just send...

But rest assured this mistake will not be repeated.

Thanx again and Regards,
Priya
>>just because the solution was not 100 % complete

Not entirly true, I copied your open statement from the question. I could not know that you wanted to do something else with it.
So, the solution *was* complete, you just needed something more than you originally asked for.

But if you agree that this should have been an A-grade (not just for me, but also for the value of this PAQ) then I can ask a moderator to correct it. Just let me know.

I assume that adding the features helped?

D'Mzz!
RoverM
Avatar of Priya25

ASKER

Hello RoverM,
I didn't know that it will so much difference to someone to get a B instead of an A..In fact I even dont know
how does EE handles the marking scheme..I must say that I'm quite new to EE.

Anyway as u mentioned, you can ask a moderator to correct it, its fine for me.
But ading the features did not work..I've already tried it..the window still opens at the back..

Regards and sorry,
Priya
Avatar of Priya25

ASKER

I have been able to make the pop screen appear on top by adding the following in my HTML

<body onLoad="window.focus()">

this works fine...
You have been of great help to me,
Thanx
Priya25,
Thanks, and it's no problem! No need to apologize! ;-)

D'Mzz!
RoverM