Jump to content


.josh

Member Since 31 Dec 1969
Offline Last Active Today, 12:57 PM

Posts I've Made

In Topic: Complex regular expression

07 October 2014 - 10:25 PM

Good lord you never give up do you.  It must be tiring being you. 


In Topic: Complex regular expression

03 October 2014 - 06:18 PM

I gave a random example to make a point that you don't know what the context is.  Instead, you deliberately try to sidestep the point in a vain attempt to try and tear me down.  You really do have issues man.  As far as everybody in this community is concerned, you are the unwanted troll, and you know it


In Topic: carry cookies into an iframe

03 October 2014 - 11:51 AM


Also the URL that the iFrame is on is different to the content of the page inside the iFrame.

 

Different...what?  Domain?  I assume that's what you meant, because if the parent/child pages were on the same domain, they could share the cookies no problem (assuming you are setting the cookies to root domain name with no subdomain or path).  So, if you meant that they are on diff domains, then the iframed page cannot read the cookies from the parent page, as this is considered cross-site scripting.

 

To get around this, you can do the following: 

 

On the parent page:

- read the cookies on parent page

- append cookies as url params to the iframe url

- generate the iframe with the url w/ the params. 

 

Then on the iframed page:

- read url params from the url

- store them in cookies (or do whatever w/ them).  Note that the iframe page will store them in its own cookies scoped for that domain, which would be separate cookies from the parent page's domain.


In Topic: Undefined error

03 October 2014 - 09:23 AM

getCurrentPosition makes an asynchronous call to a service to determine location (assuming user accepts the popup prompt to allow it).  So, you can't just assign it to x and get immediate results.  It's just like doing an AJAX call where you have a callback function (success) when results are returned.  So, you need to refactor your code to wait for success (or error) to be called.  You can use pretty much any AJAX tutorial / script for tips/principles on how to work with async calls. 


In Topic: Complex regular expression

03 October 2014 - 08:50 AM

One example of how this could be legit: maybe OP is looking for something to use in his editor's find box or w/ grep or something to find occurrences in files to help narrow down stuff he needs to search for.  

 

Maybe that is the case, maybe it is not; without context we do not know.  

 

Therefore it seems to me the best (first) response would be "What is this for? Provide some context."  And yet I don't see that from anybody.  

 

Failing that, it seems to me the best response would be to provide the asked-for solution, under the assumption that OP's reasons, while unknown, are legitimate.  

 

Failing that, I'd keep my mouth shut, because telling someone something isn't the right tool for the job when I don't know what the job is, sounds like a pretty fucking stupid thing to say. 


Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com