Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid pointer????

Status
Not open for further replies.

Greenster

Programmer
Jan 14, 2002
30
0
0
GB
Hi, I have this code which works intermittantly and I am confused. When giving a url to the windown.open command is there a limited length?? Or do I have some other problem?

I get the error "Invalid pointer" some of the time and other times its pops up the window perfectly.

Here is my code:


function pop_up_data(form){
var url = 'show_reverse_class.php?encode="' + form.encoded.value + '"&showing=' + form.showing.value;
var name = 'Window';
var win = window.open(url, name,"width=550,height=550,status=0,toolbar=0,menubar=0,location=0,resizeable=1,scrollbars=yes");
win.focus();
}

Any help would be most appreciatted

Thanks {Greenster}
 
I have removed the double quotes and I get the exact same error???

function pop_up_data(form){
var url = 'show_reverse_class.php?encode=' + form.encoded.value + '&showing=' + form.showing.value;
var name = 'Window';
var win = window.open(url, name,"width=550,height=550,status=0,toolbar=0,menubar=0,location=0,resizeable=1,scrollbars=yes");
win.focus();
} {Greenster}
 
Maybe I should add that form.encoded.value is a base64_encoded string, maybe characters in this string are breaking the url???? {Greenster}
 
If there are spaces or other non-alphanumeric characters in the URL, you'll have problems, too. If that's possible, use:

var url = 'show_reverse_class.php?encode=' +escape(form.encoded.value) + '&showing=' + escape(form.showing.value);


It's also not a good practice to call a form form, or element names by their types.
 
Thanks trollacious, unfortunately I am still having problems - I don't know much javascript and was trying to find a simple way round a certain problem, since I have a deadline of tomorrow I think I will have to find an alternative method!!!

But thanks again for your help - much apreciatted

{Greenster}
 
Have you checked the PHP file for problems? I've not seen an invalid pointer error in Javascript before, though am sure I haven't seen everything JS can do.
 
I would remove the line :

win.focus();

Since you make it popup it should appear in front anyway. See if that doesn't fix your problem. Gary Haran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top