Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 30th Jun 2014, 09:30 AM   #1
You can call me"easycash"
War Room Member
 
bwh1's Avatar
 
Join Date: 2007
Location: sunny Brazil
Posts: 2,410
Thanks: 642
Thanked 745 Times in 550 Posts
Blog Entries: 3
Default
WP Pro's - can you make this code work in a post?
Share on: 
fb share twitter share gplus share more share

Hey guy's

this is my last resource before I give up.

Can you please take a look at this and tell me how to resolve it so that one of both codes will work in a WP PAGE (not sidebar widget or post)

This is a Button code

<p>CHECK OUT A LIST OF ALL THE VIDEOS HERE.</p>

<center><button onclick="myFunction()"><strong>Quickbooks University Video List</strong></button></center>

<script>
function myFunction() {
window.open("http://qbuniversity.org/video-overview/", "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=500, left=500, width=400, height=400");
}
</script>
-------------------------------------------------------------------------------------------------------------------------------

This is a clickable image code

<a><img name="PopUpWin1" border=0 height=400 width=400 src="http://qbuniversity.org/quickbooks-university-training/quickbooks-2014-tutorials/1-introduction-to-quickbooks/flatecover/" onclick="open_win()"></a>
<script type="text/javascript">
function open_win(){
window.open("http://qbuniversity.org/video-overview/","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=500, height=480") }
</script>
I would need that this code works in my homepage, so people click at an image or button and a smaller browser window pop's up on top of my open window.

I tried WP plugins, no success as all have some poblems or work in the sidebar only or popup only once as for list building etc.

Many thanks if I can get some help from someone which knows the fix.

G.

P.S. I thought that WP 3.9 got smarter to accept code like this, but guess I'm wrong.

Affiliates Wanted! Make anywhere from 42,- to $72 in commissions. Simply Recommend the Best QuickBooks Pro Video Course available at Clickbank.
bwh1 is offline  
Unread 30th Jun 2014, 01:57 PM   #2
Active Warrior
 
Join Date: 2014
Location: UK [North Yorkshire]
Posts: 59
Thanks: 0
Thanked 9 Times in 9 Posts
Default
Re: WP Pro's - can you make this code work in a post?
Share on: 
fb share twitter share gplus share more share

Where are you entering the script? In the page editor?
How does the page render and what HTML is generated?

I may be barking up the wrong tree here but would https://wordpress.org/plugins/simple-embed-code/ help? I be never tried it , as I try to have all my JavaScript in a separate Js file rather then embedding it in the main page body
kewkii is offline  
Unread 30th Jun 2014, 07:00 PM   #3
You can call me"easycash"
War Room Member
 
bwh1's Avatar
 
Join Date: 2007
Location: sunny Brazil
Posts: 2,410
Thanks: 642
Thanked 745 Times in 550 Posts
Blog Entries: 3
Default
Re: WP Pro's - can you make this code work in a post?
Share on: 
fb share twitter share gplus share more share

Originally Posted by kewkii View Post

Where are you entering the script? In the page editor?
How does the page render and what HTML is generated?

I may be barking up the wrong tree here but would https://wordpress.org/plugins/simple-embed-code/ help? I be never tried it , as I try to have all my JavaScript in a separate Js file rather then embedding it in the main page body
Well, I click at EDIT PAGE and then click at the TEXT tab to enter that code.

The first one with the button doesn't look any different after I saved it but the button does anything at all when clicked. He appears nicely as it should but there is no link linked to the click (hope that makes sense).

The second one, the Java code, get simply cut off when saving. I looked for a plugin which let me use Javascript, but there is non to use it inside a page, in the middle somewhere as I need it.

I never used the plugin you menitoned, will take a look at it if that could help me out.

Many thanks for your help

G.

Affiliates Wanted! Make anywhere from 42,- to $72 in commissions. Simply Recommend the Best QuickBooks Pro Video Course available at Clickbank.
bwh1 is offline  
Unread 1st Jul 2014, 02:05 AM   #4
Active Warrior
 
Join Date: 2014
Location: UK [North Yorkshire]
Posts: 59
Thanks: 0
Thanked 9 Times in 9 Posts
Default
Re: WP Pro's - can you make this code work in a post?
Share on: 
fb share twitter share gplus share more share

I just tried the code that you posted and it worked OK (I did change URL). Tried it on FireFox and the latest Chrome looking at a local website running WordPress 3.8.. Do you have the URL of the page that isn't working?
kewkii is offline  
Unread 1st Jul 2014, 03:02 AM   #5
Active Warrior
 
littleCowCoding's Avatar
 
Join Date: 2014
Location: Hampshire, UK
Posts: 33
Thanks: 8
Thanked 18 Times in 11 Posts
Default
Re: WP Pro's - can you make this code work in a post?
Share on: 
fb share twitter share gplus share more share

I have tried the code in isolation and it does work but here are the things I noticed that are wrong with it.

1) there should be no space between parameters in your window.open function.
i.e.
window.open("http://qbuniversity.org/video-overview/", "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=500, left=500, width=400, height=400");

Should be

window.open("http://qbuniversity.org/video-overview/","_blank","toolbar=yes, scrollbars=yes, resizable=yes, top=500, left=500, width=400, height=400");

Internet Explorer will have problems if there are spaces.

2)
Use a suitable function name myFunction helps no one. Also you use two scripts to do the same thing. Rename the popup to something useful like popupVideoOverview()

Then just reference the function in both links.

3)
In the img javascript there is no such parameter as copyHistory.

4)
The img you link to is not a valid URL, you need the image full src.

5)
The page you link to is full of errors to.

Regarding it not working in wordpress when you enter the javascript try putting in a XML parser exclude tag. like this..

<script>// <![CDATA[
function myFunction() {
window.open("http://qbuniversity.org/video-overview/","_blank","toolbar=yes, scrollbars=yes, resizable=yes, top=500, left=500, width=400, height=400");
}
// ]]></script>

Let us know if that helps

littleCowCoding is offline  
The Following User Says Thank You to littleCowCoding For This Useful Post:
Unread 1st Jul 2014, 03:55 PM   #6
You can call me"easycash"
War Room Member
 
bwh1's Avatar
 
Join Date: 2007
Location: sunny Brazil
Posts: 2,410
Thanks: 642
Thanked 745 Times in 550 Posts
Blog Entries: 3
Default
Re: WP Pro's - can you make this code work in a post?
Share on: 
fb share twitter share gplus share more share

Hey, thanks guys

I took the code off the page (it didn't worked so why leaving it there)

I'm very happy for your help, will see to squeeze some time to try those tips. Have a bit a stressy week so don't know if I can do it but as soon as I can I will let you know.

G.

Affiliates Wanted! Make anywhere from 42,- to $72 in commissions. Simply Recommend the Best QuickBooks Pro Video Course available at Clickbank.
bwh1 is offline  
Unread 1st Jul 2014, 03:57 PM   #7
You can call me"easycash"
War Room Member
 
bwh1's Avatar
 
Join Date: 2007
Location: sunny Brazil
Posts: 2,410
Thanks: 642
Thanked 745 Times in 550 Posts
Blog Entries: 3
Default
Re: WP Pro's - can you make this code work in a post?
Share on: 
fb share twitter share gplus share more share

Originally Posted by kewkii View Post

I just tried the code that you posted and it worked OK (I did change URL). Tried it on FireFox and the latest Chrome looking at a local website running WordPress 3.8.. Do you have the URL of the page that isn't working?
So you put that code into a page, in the TEXT feauture and it worked? Both?

I'm running WP 3.9 and the theme is ProfitsTheme, but that shouldn't make any difference.

G.

Affiliates Wanted! Make anywhere from 42,- to $72 in commissions. Simply Recommend the Best QuickBooks Pro Video Course available at Clickbank.
bwh1 is offline  
Unread 2nd Jul 2014, 04:33 AM   #8
Active Warrior
 
Join Date: 2014
Location: UK [North Yorkshire]
Posts: 59
Thanks: 0
Thanked 9 Times in 9 Posts
Default
Re: WP Pro's - can you make this code work in a post?
Share on: 
fb share twitter share gplus share more share

Originally Posted by bwh1 View Post

So you put that code into a page, in the TEXT feauture and it worked? Both?

G.
I know! I was surprised it worked too! Post a link to the problem page when you can.
kewkii is offline  
Unread 2nd Jul 2014, 11:08 PM   #9
Senior Warrior Member
War Room Member
 
kpmedia's Avatar
 
Join Date: 2010
Location: USA, Europe
Posts: 1,163
Thanks: 57
Thanked 266 Times in 213 Posts
Default
Re: WP Pro's - can you make this code work in a post?
Share on: 
fb share twitter share gplus share more share

Just write a custom page template.
Something like this is really, really easy to do.

kpmedia is offline  
Unread 3rd Jul 2014, 11:07 PM   #10
HC STUDIOS
War Room Member
 
Join Date: 2005
Location: India
Posts: 68
Thanks: 85
Thanked 5 Times in 5 Posts
Default
Re: WP Pro's - can you make this code work in a post?
Share on: 
fb share twitter share gplus share more share

Hi bwh1,

I suggest not to take off the code as it didn't work. We can sort out the issue. If you need help please do not hesitate PM me. I will try to help you.

Cheers
Dhana

pdhana is offline  
Closed Thread


Bookmarks

Tags
make, post, pro, work


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 01:02 AM.