Over the last day, I've been tackling the FreeCodeCamp assignment "quote machine". Everything is working fine except for the tweet button. You can tweet as many times as you like for one single quote, but not for multiple quotes (once you tweet one, you can't move on to the next quote and tweet that).
When I try to open a new window, I encounter the following error:
DOMException: Permission denied to access property "apply" on cross-origin object
I've been researching this error for a while now, but I haven't found a solution that I can implement.
Here's the project (it's quite small)
snip
// snip
methods:{
twitter() {
this.twitter = window.open('https://twitter.com/intent/tweet/?text='+this.quote+'&hashtags=quotes');
},
refreshQuote() {
// etc
<a @click="refreshQuote">
///
</a>
<v-btn fab depressed outline large class="center" @click="twitter">
The reason I'm using tweet()
is because I couldn't get window.open
to work with @click
; I received the error:
Error in event handler for "click": "TypeError: window is undefined"
Thank you.