Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums on April 1st. BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com


Reply
Developer
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified
Accepted Solution

Issue with document.referrer in Playbook

Hi,

 

The javascript property document.referrer is returning empty value in my app when I navigate between pages. It is supposed to return the previous page url. But this is working fine in inbuilt browser of Playbook when I access the page using a local server setup. Any thoughts on this?

 

Thanks in advance

Praveen

Retired
Posts: 172
Registered: ‎06-07-2010
My Device: BlackBerry 8520
My Carrier: Rogers

Re: Issue with document.referrer in Playbook

Hello Praveen,

 

How are you doing? I hope all is well.

 

Can you provide a sample code to easily reproduce this issue. From my tests, I've not seen any issue.

 

Looking forward to your reply.

Raihan Masroor
BlackBerry Development Advisor
Developer
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified

Re: Issue with document.referrer in Playbook

[ Edited ]

Hi Raihan,

 

Let me explain it with some sample codes.

 

This is my first HTML file -- index.html

<html>
<head>
<title>Sample</title>
</head>
<body>
Index.html
<a href="next.html">Next</a>
</body>
</html>

 

and my second HTML file -- next.html

<html>
<head>
<title>Sample Next</title>
<script src="jquery.js"></script>
<script>
$(document).ready(function(){
alert(document.referrer);
});
</script>
</head>
<body>
Next Page
</body>
</html>

 

When I navigate from index.html to next.html in my browser setup with local server, I get the url as 'http://localhost/sample/index.html'. But it returns empty value when i navigate the same in playbook.  I'm not sure if this is an undesierable effect. Please let me know your thought on this.

 

Highlighted
Retired
Posts: 172
Registered: ‎06-07-2010
My Device: BlackBerry 8520
My Carrier: Rogers

Re: Issue with document.referrer in Playbook


Hey Praveen,

 

Thanks for the snippets for which I now have a much better understanding what you are trying to do.

 

The document.referrer value coms from an http response header that gets populated only by a Web Server. This is the reason why I wasn't able to reproduce from the Browser on the PlayBook.

 

Local WebWorks content does not use a Web Server and so this value is empty.

 

I hope I have clarified your issue.

Raihan Masroor
BlackBerry Development Advisor