• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 278
  • Last Modified:

javascript code

Hi,
can anyone please interpret those lines:


thanks in advance;
location.href = 'pag~;
ctrl[i].id.replace(/header/g,'')
onclick="location.href='pag~;~14!Button=AdvForm&id=1'"

Open in new window

0
ethar1
Asked:
ethar1
1 Solution
 
d4durveshCommented:
can we know what you are trying to do with this? please through some more light on your query
0
 
Dushyant SharmaCommented:
That is incorrect syntax.
First line
location.href = 'pag~;

has an error "unterminated string literal". now even if you complete it as 'pag~'; it will change the url of the page to pag~ so that page will reload and rest of the lines will not be executed.

line 2
ctrl[i].id.replace(/header/g,'')

Open in new window

replaces all occurrence of header in the given string, but it will not store results anywhere so the replace will have no effect. it should be something like
var tmp=ctrl[i].id.replace(/header/g,'')

Open in new window


line 3

onclick="location.href='pag~;~14!Button=AdvForm&id=1'"
will change the location (url) to the given string (which is not looking like a proper url or parameters)

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now