w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Sandbox iframe attribute isn't preventing redirects in FIrefox
If you are manipulating or setting the sandbox attribute after the iframe is in the DOM, it will completely ignore the setting. You must set it before the iframe element is added to the DOM.

Categories : Javascript

How to attach a signal to a slot for an object created dynamically
These checkboxes are not widgets or separate objects and the QStandardItem class doesn't derive from QObject, you can't connect each of them individually to a slot. Since their state is stored in the model, checking or unchecking them will make the model emit the signals dataChanged(QModelIndex,QModelIndex) and itemChanged(QStandardItem*). But these signals are also emitted for changes other than the checkbox state. You might have to store the checkbox previous state in the model as well (with QStandardItem::setData/data and a custom data role) to be able to compare it to the new state and detect a change.

Categories : C++

Is it possible to insert a style tag in the head of a dynamically created iFrame?
On provided jsfiddle, you cannot access iframe content due to same origin policy. In fact, fancybox set src attribute of image to the iframe. So, maybe test it on same domain (same as image) and try to access iframe contents like that: afterLoad: function () { $('.fancybox-iframe').contents().find('head'); }, But i think its not the right way to do it because the content will already beeing displayed. I'll suggest to embeded image in its own html page, this way you could apply any style you wish, for example, test this and see there if its expected result: http://jsfiddle.net/5QSnK/show/ This is link to embeded image page, used for the example: http://jsfiddle.net/Stb6A

Categories : Jquery

Can't create subscription button in sandbox (redirects to live site)
Well, this is obviously just a bug on the PayPal website. The "Create payment buttons for your website" button goes to the live PayPal website instead of the sandbox, but I found a workaround. Click on Merchant Services Click on "My saved buttons" Click on "Create new button" That kept me in the sandbox site and allowed me to create a button.

Categories : Paypal

Read dynamically created elements data attribute in jquery?
this in your example is the div id=hotels. It would have worked if you would have gone INTO the div and selected the button. I propose another solution though. http://jsfiddle.net/6kdHG/3/ You can use the target of the event to get the information you want. $("[id^='hotel']").on('click', function (e) { thisHotel = $(e.target).data('hname'); $("#selected").html("Selected Hotel " + thisHotel); }); e is the event that got triggered and you simply access it's target.

Categories : Jquery

Redirects within an iframe using php
With HTML5 the iframe sandbox attribute was added. At the time of writing this works on Chrome, Safari, Firefox and recent versions of IE and Opera but does pretty much what you want: <iframe src="url" sandbox="allow-forms allow-scripts"></iframe> If you want to allow top-level redirects specify sandbox="allow-top-navigation".

Categories : PHP

Does an iframe on a subdomain provide an adequate JS sandbox?
There are risks associated with untrusted and unsafe Javascript - no matter whether it is run in an iframe or not. However the Same Origin Policy dictates that any scripts in your sandbox will not be able to interfere with anything in example.com.

Categories : Javascript

How to append jQuery events to an iframe with sandbox?
Attaching events to the content of a sandboxed iframe is the same as running the javascript from the iframe, hence it cannot be done. I solved the problem of stopping JS execution by prepending in the <head> of the document the following: <script>Function.prototype.call = Function.prototype.apply = function(){};</script> EDIT: it seems like this is not enough. I finally decided to simply strip the <script>blocks from the document.

Categories : Jquery

Paypal Sandbox Merchant Account History Tab Redirects To Main Paypal
It is part of a known issue mentioned here: PayPal Sandbox history redirects to REAL history I'll be updating that thread when the problem is resolved. You can also create a ticket and mention the ticket number on that thread, I'll grab it, and keep you posted as it goes on.

Categories : Paypal

PayPal Sandbox history redirects to REAL history
It's a known issue - sorry. Trying to change the URL to the Sandbox one still redirects you to the Live site and, occasionally for whatever reason, a security certificate page. A fix is coming soon. If you want to be updated on the issue as it goes on you create a ticket at PayPal.com/mts, let me know what the ticket number is, and I can grab it. Edit: This should be resolved now. I cleared my cache and cookies, closed the browser, and tried it out. I was able to view the transaction history in the Sandbox.

Categories : Paypal

Removing a dynamically created ViewGroup by dynamically created button
All ViewGroups have some flavors of removeView(). You may have to keep references to some of your views with instance variables.

Categories : Java

Nginx https redirects - stop further rules processing
I usually like to use return instead of rewrite for redirects, try matching the path with a location block location ~ /path/resource(.*) { return 301 $scheme://newdomain.com/newpath/resource$1; } I think this way you know for sure there will be no further processing, because it's only 1 line, try it and tell me how it goes. PS: This will maintain the $scheme of the request, requests to http:// will be redirected to a http:// and https:// will be redirected to https://

Categories : Http

how to attach image to gui created by using Qt creator
You can create a QWidget or a QFrame at the place you want to add an image. You can then use the style sheet to set a background-image on that picture. You might want to add your image to your ressources (.qrc). Using QtDesigner is a good idea for this kind of task. EDIT : Here is an easy way to do that without bothering with QPixMap. QWidget *frame = new QWidget(this); frame->setGeometry(x, y, width, height); frame->setStyleSheet("background-image: url(:/path/to/image.png)"); The : specifies that you want to use the path in your Qt resources. The first two lines are not needed if you define this QWidget using QtDesigner. Also, don't forget to import your resources.qrc (however you called it) file (including your resources) and add this to your .pro : RESOURCES = resourc

Categories : C++

MongoDB - How to Determine Date Created for Dynamically Created DBs and Collections?
For database: You can check the creation time for "database-name.ns" file ls -l test.ns -rw------- 1 root root 16777216 Jun 12 07:10 test.ns For collection: Most of time collection is created when you insert something into it. So, if you are not creating the collection using createCollection() command and you are using the default ObjectId for _id key, then you can get a rough estimate of the creation of the collection by knowing the time at which the first document inserted in that collection. Mongo > db.test.find().sort({$natural : 1}).limit(1).toArray()[0]._id.getTimestamp() ISODate("2013-06-12T01:40:04Z")

Categories : Database

Dynamically add values to newly created dropdownlist instead of previously created
I can see that you give the same id to each created select. This violates the HTML convention - the id of an element must be unique. If there are several elements with the same id, selecting by that id usually returns the first matched element (in your case the select in the first row). To avoid this problem you could append a unique number to the id (productopt_1, productopt_2 etc) or create a select with its contents first and then append it to the row: $('#additems').click(function() { $.getJSON('Servlet1', function(json) { var row = $('<tr id="shipdetail" style="margin-top:20px;"></tr>'); row.append($('<td><input type="text" id="cptd"/></td>')); var select = $('<select class="productopt" tabindex="1"></select>');

Categories : Java

How to attach event handler to ExtJs Component before it is created
If you want to assign event handlers to dom elements before the elements are created then you can use this answer http://stackoverflow.com/a/8081472/842075. If you want to assign event handlers to components before the components are created then all you need is Ext.app.EventBus.controll method (it is used internally by mvc controllers): var listeners = { 'textfield[cls="mycls"]': { change: function() { alert('textfield with cls="mycls" changed'); } } }; Ext.app.EventBus.control(listeners, scopeObject); Note that Ext.app.EventBus is not present in sencha docs. The examples of usage of control method may be found in documentation for Ext.app.Controller.control method. Here's demo. If you are using extjs mvc than just use Ext.app.Controller.control method.

Categories : Extjs

MVC4 [Authorize] Attribute, change where it redirects when a user is not loged in
If you are using Forms Authentication you can edit the URL in the web.config file in the root of your application. The section will look something like the following. <system.web> <authentication mode="Forms"> <forms loginUrl="~/Account/Login" timeout="2880" /> </authentication> </system.web> Change the loginUrl attribute and you are good to go :)

Categories : Asp Net Mvc

how to attach the programmatically created EXCEL to SMTP MAIL in the application?
Here is some refactored code that might help: private static Stream DataTableToStream(DataTable table) { const string semiColon = ";"; var ms = new MemoryStream(); var sw = new StreamWriter(ms); foreach (DataColumn column in table.Columns) { sw.Write(column.ColumnName); sw.Write(semiColon); } sw.Write(Environment.NewLine); foreach (DataRow row in table.Rows) { for (int i = 0; i < table.Columns.Count; i++) { sw.Write(row[i].ToString().Replace(semiColon, string.Empty)); sw.Write(semiColon); } sw.Write(Environment.NewLine); } return ms; } private static MailMessage CreateMail(string from, string to, string subject, string body, string attname, St

Categories : Asp Net

How do I get the id of a newly created resource in a Joosy.Form.attach callback?
The newly created id will be in the data parameter as long as it's returned in the json for the resource being created. In my case, I needed to edit the default app/views/presentations/show.json.jbuilder to add the :id field.

Categories : Misc

jQuery - Attach to Element Dynamically
actually you need to call textareaCount(options) again after document ready by your ajax for example when you click on a button you want to count the textareas: $("#button").off('click').on('click', function() { $('textarea').textareaCount(options); }); or this for earlier jquery versions $("#button").die('click').live('click', function() { $('textarea').textareaCount(options); });

Categories : Jquery

How to append a dynamically created div to another dynamically created div?
Instead of document.parent_div.appendChild() use parent_div.appendChild(). document.parent_div is looking for the parent_div property of the document whereas parent_div is the variable referencing the div you just added.

Categories : Javascript

Attach profile fields to created users in Symfony and sfDoctrineGuard plugin
try adding a foreignAlias for sfGuardUser in SfGuardUserProfile entity, like: relations: SfGuardUser: local: user_id foreign: id type: one foreignAlias: SfGuardUserProfile

Categories : Symfony2

How to open the same jQuery Dialog from dynamically and non-dynamically created controls
I suspect it's because you're using destroy() rather than close() on the dialog. At the moment it looks like you're creating and destroying the dialog each time, don't do that. You should create the dialog once, isolate the dialog functionality to a separate function, and then just use open() and close() on it (you'll have to do some extra work to get the values into the right fields). You can make your current code work if you style the dialog as hidden it'll stop happening, add this to your HTML (in the <HEAD>): <style> #dialog-form { display: none; } </style> you should probably have a separate style-sheet file you include that has that style in it. Similarly you should put all your JS in a separate file if it isn't already. But I'd definitely look at re-wr

Categories : Jquery

Assign dynamically deserialized value to dynamically created instance
The simplest way would be to write a method that copies the attributes from one object of this type to another: static void CopyAttributesOnto(theType dest, theType source) { dest.a = source.a; dest.b = source.b; // ... } // Then you can just do this: CopyAttributesOnto((theType)theInstance, (theType)deserialized); Another option would be to build a DynamicMethod at runtime and create a delegate from it. You will pay once for the cost of reflection and JIT compilation of the new method, but every invocation of the method will have no more overhead than the use of any other delegate.

Categories : C#

How to add values to attribute added dynamically to property without attribute constructor(Reflection.Emit)
You use CustomAttributeBuilder. For example: var cab = new CustomAttributeBuilder( ctor, ctorArgs, props, propValues, fields, fieldValues ); prop.SetCustomAttribute(cab); (or one of the related overloads) In your case, that looks (this is pure guesswork) something like: var attribType = typeof(DisplayAttribute); var cab = new CustomAttributeBuilder( attribType.GetConstructor(Type.EmptyTypes), // constructor selection new object[0], // constructor arguments - none new[] { // properties to assign to attribType.GetProperty("Order"), attribType.GetProperty("ResourceType"), attribType.GetProperty("Name"), }, new object[] { // values for property assignment 28, typeof(CommonResources), "DisplayComment" }); p

Categories : C#

dynamically attach mdb database file in c# windows desktop application
Sir, your question includes lot of other question. Not Code Specific, but you will need to consider following things: You will need to check the file extension(.mdb) for each selected file as a backup. Then you will need to rename the file to your actual database name. Eg. If backup is saved as filename : "1 Aug" then you need to rename it while uploading as backup of your database. By this you will simply get access to all the previous data. For security purpose you can keep password to your mdb sheet. Corrosponding Links: File Path Check: C# After using OpenFileDialog, a MessageBox doesn't open on top Rename FileName : Rename files name in a folder MDF Password Protection

Categories : C#

How to dynamically add an ondragstart event to a dynamically created div
You'll be better to take a look at Jquery UI draggable here and if you dont know yet, you can call multiple jquery finctions in a chain, so your code looks more readable like below: var group=$('div').attr('id', 'group'+grpcount) .addClass('group') .html("<span class='group'>Group"+grpcount+"</span>"); $('#boundary').append(group); and instead of document.getElementById('group'+grpcount).addEventListener("startdrag",drag); use this group.draggable({ start:function(event, ui){ //this is where dragging starts when you push mousedown and move mouse }, drag:function(event, ui){ //this function will be called after drag started each time you move your mouse } stop:function(event, ui){ /

Categories : Javascript

WSO2 API Manager not directing to Sandbox based on Sandbox Key
When looking at your mentioned issue,I think you have used the 'PRODUCTION' scoped access token to invoke your SANDBOX endpoint. After you defined two different endpoints as sandbox URL and production URL when creating the API,to invoke them you need to use different access tokens based on its scope [PRODUCTION/SANDBOX]. To invoke SANDBOX endpoint from your API,you need to use SANDBOX access token. To find these production and sandbox endpoints related keys,you can navigate to APIStore->My Subscriptions page and view the keys under sections of 'production' and 'sandbox' in the particular subscription.And under each 'PRODUCTION/SANDBOX' keys section of subscriptions page,you'll see a separate access token and consumer key/secret. Try invoking your SANDBOX endpoint of API,with above shown

Categories : Api

Programmatically created iFrame is empty
Instead of creating literal (and btw, you cannot create runat="sever controls these way) try creating actual IFRAME control: HtmlGenericControl c = new HtmlGenericControl(); c.TagName = "IFRAME"; c.Attributes["src"] = filePath; c.Attributes["id"] = "embeddedFrame"; c.Attributes["name"] = "embeddedFrame"; c.Attributes["width"] = "400"; c.Attributes["height"] = "400"; ph.Controls.Add(c); And make sure that the path is available from your browser, not only from the server.

Categories : C#

Wordpress blocking iframe automatically created
Fixed this. Here's the answer: http://www.neilmarion.com/index.php/fixing-an-obtrusive-wordpress-theme/

Categories : Wordpress

iframe width attribute is being ignored
100% width works: div.sttip iframe{ width: 100%; height: auto; } http://jsfiddle.net/eNfHZ/1/ You won't be able to maintain aspect ratio though, you'll have to use Javascript to calculate the height using a onResize event handler.

Categories : CSS

filtering src attribute of iframe in ios
Sample Code : NSString *myString = @"&lt;iframe width=&quot;560&quot; height=&quot;314&#39;&#39; src=&quot;http://www.youtube.com&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;"; NSRange firstRange = [myString rangeOfString:@"http://"]; NSRange secondRange = [[myString substringFromIndex:firstRange.location] rangeOfString:@"&quot;"]; NSRange finalRange = NSMakeRange(firstRange.location, secondRange.location); NSString *subString = [myString substringWithRange:finalRange]; NSLog(@"subString :: %@",subString);

Categories : Iphone

Angular : src attribute bug in Iframe directive
Instead of using 'link' use the 'compile' function, as you're essentially wanting to modify the HTML before insertion into the DOM. I think 'link' is inserted, and then bound to the scope. So with link 1. compile is called with {{url}} - request by iframe is made 2. link is called, and {{url}} is replaced, hence you second call. If you use 'compile' you can modify the src attribute yourself. Give http://docs.angularjs.org/guide/directive a look over, hope this helps Edit Check this fiddle http://jsfiddle.net/jbSx6/20/ return { restrict: 'E', require: '?ngModel', replace: true, transclude: true, template: '<iframe src="%url%" height="100%" width="100%" frameborder="0"></iframe>', compile: function (element, attrs, transclude) { console.log(el

Categories : Javascript

Rails: Interpolation, Attribute into iFrame Link
Oh! I get it... change it to: <iframe src="https://mywebsite.com/<%= @vine.video_link %>/"></iframe> You only need to do interp. like that if it's inside ruby code. In this case you're not escaping a string in ruby, you're just putting it in HTML (view). Example. If you were in a controller, let's say and had a string that looked like variable = "<iframe src='https://mywebsite.com/#{@vine.video_link}/'></iframe>" Edit to correct bad copy/paste job.

Categories : Ruby On Rails

Remove target attribute in iframe link
Not directly that I am aware of. However, if you have access to a scripting language (like PHP or ASP) on your site you can read your vendors' page directly from your server, do a find & replace on it & then render that onto your site; either in an iframe or however else you want. Edit There are many ways to do this, depending on how much control you have over you PHP config. Have a look at these resources & see if you can figure out what to do. If not I would suggest you start a new question specifically focused on what it is you are struggling with. http://php.net/manual/en/function.file-get-contents.php With this method you have to be aware of the tip on the page: A URL can be used as a filename with this function if the fopen wrappers have been enabled. See f

Categories : Javascript

How widely supported is the iframe attribute "allowfullscreen"?
I've started discovering some of my own answers: FireFox: Added support in v18 (January 8, 2013) - Source Chrome: Added support in v27 (May 22, 2013) - Source Safari: Added support in v7 (October 22, 2013) - Source Internet Explorer 9: Not supported Internet Explorer 10: ??? Microsoft Edge: ??? It seems to be difficult to find detailed release notes for the other three, unfortunately.

Categories : HTML

Access anchor tag attribute inside iframe
Since they pages appear on different origins: The page containing the frame needs to listen for a Message event. The page inside the frame needs to send a message using postMessage. This, obviously, requires changes on both sites. Explicit co-operation between the sites is required for obvious security reasons (if they aren't obvious, imagine your bank's website being loaded in an iframe by a random site you visited via Google).

Categories : HTML

set the src attribute of an iframe, then load into page, using javascript
You should do a console.log on the location.search. It gives you a string you need to parse, e.g., "?key=value&key2=value2&etc=another+value". I think you might need to address that. So if where it says list= needs to be just tupac, you're going to need to convert your search string from a string that looks like this: ?query=tupac to a string that looks like this tupac by doing something like: var query = location.search.split('=')[1]; What this does is it splits the string up into two pieces, using the = sign to divide them, then using [1] to select the second piece (array indices start from 0). Then you'll have just the tupac portion of the string (or whatever the query string is for [e.g., U2]). If your query string has multiple parameters, you needs to parse each of those

Categories : Javascript

To stop ClickJacking, which one is more secure? breaking out of iframe vs X-Frame-Options to Deny or Same Origin
In my experience, setting X-Frame-Options (XFO) rules works much better than breaking out of iframes. When it comes to rules, it really depends on if you absolutely have to use iframes. If you can remove iframes from your website completely, using the DENY rule would be best; however, if you still have iframes in your site, use the SAMEORIGIN rules. The differences between the available rules are outlined below (quoted from IETF): DENY A browser receiving content with this header MUST NOT display this content in any frame. SAMEORIGIN A browser receiving content with this header MUST NOT display this content in any frame from a page of different origin than the content itself. If a browser or plugin can not reliably determine whether the origin of the

Categories : Javascript

dynamically set target of form to iframe conditionally
You didn't mention whether you are using ajax to submit the form. If its ajax then it would be straight forward, I think you are not. If you are doing a normal form submit, then Don't target the form submit to an iframe. That solves your problem but it introduces a new one, handling the PDF response. When your form submission passes the validation instead of returning the PDF return the same view but with some javascript code, dojo in your case, at the bottom of the page to popup an iframe whose url points to the pdf stream. If you are using Spring MVC 3.1 you can make use of Spring MVC Flash Attributes to share any data between your form processing method and PDF serving method, If you are using previous versions of Spring you can use Session or capture the information in the red

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.