0

Hi JavaGeeks, i am trying to get context path of my Applcation. But it is showing errors in that. Can you please mention the way how to get context path in javascript functions.

4
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by Troy III
0

Ok. Then how can i get the context path.?
I have a code like this.

case 6: {//print
				LeftPosition = (screen.width) ? (screen.width-290)/2 : 0;
				TopPosition = (screen.height) ? (screen.height-240)/2 : 0;
				var _h=options.values.length*23;
				settings = 'height='+_h+',width=245,top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable';
				saveField = options;
				win = open('/dnweb/pages/favorite.jsp','Print_Favorite_win',settings);
				win.focus();
				break;
			}

i have to change

/dnweb

context as dynamically.

0

Ok. Then how can i get the context path.?
I have a code like this.

win = open('/dnweb/pages/favorite.jsp','Print_Favorite_win',settings);
				win.focus();
				break;
			}

i have to change

/dnweb

context as dynamically.

You can use a variable value concatenation with the string path value.

var contextPath = "";
    contextPath = "\/dnWeb2"; //the value assignment is done for illustration purpose here
            win = open( [B]contextPath[/B] + '/pages/favorite.jsp','Print_Favorite_win',settings);
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.