Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi,

I am linking a page to another page like this
HTML
<a href="faqs.html?showData=5&letter=B" target="_blank">


So on the faqs page it is showing data related to 5 and in that 5 data showing the letters that start with B but in the B I need to call exactly one question.

JavaScript
function checkIfAny()
{
  qs(); 
  showData(whichPage);
  window.location.hash = whichLetter;  
}

function qs() 
{
    var query = window.location.search.substring(1);
    var parms = query.split('&');
    for (var i=0; i<parms.length; i++) 
    {
        var pos = parms[i].indexOf('=');
        if(i==0)
        {
            whichPage=parms[i].substring(pos+1);
        }
        else if(i==1)
        {
            whichLetter=parms[i].substring(pos+1);
        }
    }
    return "";
}
var whichPage;
var whichLetter;


Is there a way to do it like that and thanks in advance for your help.
Posted
Updated 27-Sep-11 7:26am
v3
Comments
Ed Nutting 27-Sep-11 13:17pm    
Your code seems sound but... Can you give us more detail as to exactly what you're trying to achieve? What do you mean, 'call exactly one question'? What do you mean by 'call'? What is your page displaying? It's very unclear at the moment... What does your showData method do? Could you also please format your code properly to make it readable (Hint: Use <pre> blocks!) - Done for OP by me.
anil132 27-Sep-11 13:30pm    
from a different page i am linking the faqs page and in that faqs page i have 25 questions start with different letters but in that letter B i need particular question to be on top ........but right now it opens questions start with letter B......I have 5interlinks in faqs so my Show Data is opening the 5block.

I hope iam clear now

The anchor tags can be used to navigate between pages as well as within a page.

You could create a tag I front of the FAQ topics, such as
HTML
<a href='#faq5'/>FAQ 5

Then construct the link as
<a href='FAQ.HTML#faq5'>Help item 5</a>
 
Share this answer
 
v3
Comments
anil132 27-Sep-11 14:07pm    
can you please explain a bit clear.
[no name] 27-Sep-11 14:19pm    
what is it that is unclear?
anil132 27-Sep-11 14:28pm    
for construct the link
u learn html again and try .I know u learn again deeply to find answer for this
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900