Locate Some Text Within An Iframe?
Aug 16, 2010I'm trying to locate some text within an iframe highlighting the string found.
View 4 RepliesI'm trying to locate some text within an iframe highlighting the string found.
View 4 RepliesI am in a little over my head here trying to make a template for this PHP script. I am trying to work out all javascript errors.
So far I only have one error on the index page and no other pages. In IE8 at the bottom it shows me the little error icon and when I click it, it shows me:
Line: 2
Char: 18579
Error: Object doesn't support this property or method
Code: 0
URL: http://www.mysocialengine.com/demo/woolton/index.php
I am trying to locate this error in the source code, but cannot figure it out. Can someone maybe take a look at the source and point me in the direction to what IE8 is finding as an error? It's weird that there are javascript errors only on the home page when I use the same header and footer file for the entire web site.
I've included a js file in the header of the site which utilizes a function in a php file. Just the standard <script language="javascript" src="[URL]"></script>
In the .js file I'm setting the location to a php file as a variable...
var url="/file-here.php";
url=document.location.host+url;
Obviously the document.location.host isn't working for me but here's what's going on... At first I just had, var ="[URL]"; in the js file. So if the user is on [URL] the script will work, however if the user is on domain.com/some-directory/another the script won't work, because I've included www. in the variable within the js file.
However, if I set it to var ="[URL]";, it will work on domain.com/some-directory/ but not on [URL]. So basically I need to return the host url somehow, depending on if the user is on the page with www. or without www. so it will always work. With php, I could just use $server['HTTP_HOST']/file-here.php and it will always return www.domain.com or domain.com depending on the URL the user is on, but obviously php won't work in a js file so I'm looking for the correct string/command to get this. How to return just the www.domain.com or domain.com portion of the current URL with javascript? So no matter where they are on the site, with or without www. the script can still function by having the correct URL to the PHP file at all times?
I'm having difficulties writing a script that should do the following:
1. "visit"/connect to a website
2. search after rss feeds on the site
3. grab the rss link and make it useable for other scripts (array...)
I'm having a problem with some dynamically loaded content.
1. Ajax request returns some content that goes in a div. Inside that content, there's a text box with the id "coupon"
2. Also inside that content is a script called add_coupon that sends another ajax request. Use pushes a button, function gets called, all is well.
3. Inside the function, "document.getElementById ( 'coupon' )" returns undefined.
Behold:
<script language='javascript'>
function add_coupon() {
document.getElementById('cart_cc').innerHTML = "<img src='spinner.gif'>";
var coupon = document.getElementById('coupon');
if ( !coupon )
alert ( 'no coupon box' );
$(function() {
$.ajax({
type: 'POST',
url: '/store/ajax_add_coupon/'+$('#coupon').val(),
success: function(data) { $('#cart_cc').html(data); }
});
});
}
</script>
<span style='float: left;'>Coupon: <input type='text' id='coupon' size=15/> <input type='button' value='Add' onclick='add_coupon();' class='btnGreenCSS'/></span>
it is required to locate the typing cursor in field after when click ok on java alert [URL]
View 2 Replies View RelatedI have a page within which is an iframe, and within that iframs is a text area. I need to be able to insert text into that text area from the mother page. I have tried to insert it with the following code but it's not working :
<iframe src ="http://iframepage.com" id="myIframe">
<p>Your browser doesn't handle iframes</p>
</iframe>
<input type="button" value="Go" onclick="document.getElementById('myIframe').contentDocument.getElementById('textArea').value = 'test successful';">
Inside the iframe is this code for the text area :
<input class="text" size="50" name="area" id="textArea" value="" maxlength="255" onkeyup="checkconditions(this.value, this.name, this.type)" type="text">
I've also tried to insert it using this script :
<script>
function insertText() {
[code]....
But nothing works.
On click of a link , the contents get displayed in an iframe. Is there a way to search some text in the content displayed in the iframe and highlight it.
View 1 Replies View RelatedI use the following code to create a hidden iFrame on a page, dynamically code...
Should have given me the value in 'text01', but it doesn't. It doesn't work even inside the iFrame's onload event.
('text01' is a textbox which is on the page inside the iFrame - its name and id are both 'text01')
Is there any other method to get the text in a textbox within an iFrame?
how to get started on how to make a scrolling text on an iframe..like a scrolling news on a page.
View 6 Replies View RelatedIm trying to access a string in a textbox which Is located within an iframe on the parent document but the iframe is linked to a source html file.I know of document.getElementById('textbox').valueBut because its within an iframe which is getting its data from another html file Im having difficulty.
View 1 Replies View RelatedI need to highlight words in text inside iFrame (target page is actually from another site). Code:
Is it possible to force this script to highlight text inside iFrame? Or probably there is another solution exists?
I can't get this to work, but I'm trying to update the text into an iframe on the same page with a button, for a game I'm making, the battle messages when you attack.
Here is the html file with the button and onClick
Code:
And here is the iframe code
Code:
I am looking for an input text that links to a iframe. . ?
To begin, we need some simple HTML elements:
A basic form; An Input text that will contain the URLs we want to use; An iFrame that will display the page we select from the input text.
[URL]
I would like to utilize this script where I could pass the string of words to another page.
Meaning, search for the text, actually a word, then take the two words following the searched text and have them passed to the next page...I have tried to "alert" the words, but have no success.
I have tried to modify the code using the following, but the result just posts a "-1" in my alert popup.
As you can see I modified the code from the original thread in the third block of "for" code. also, I added an "alert" tag. One more thing, I added a function call for the form button.
The code is below:
<script type="text/javascript">
var count = 0;
var itemList = new Array();
var oldText = "";
[Code]....
I have code like:
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"[URL]">
<html xmlns="[URL]" xml:lang="en" lang="en">
<head><title></title>
<script type="text/javascript" src="javascript/jquery-1.4.1.js"></script>
<script type="text/javascript" src="javascript/jquery.blockUI.js"></script>
</head><body>
<script language="JavaScript" type="text/javascript">
$(document).ready(function(){
$daemach.debug = true;
$('#loadContent').click(function(){
$.frameReady(function(){
$.blockUI();
$('<div></div>').addClass('box2').appendTo("body").load("ajaxcontent.cfm",$.unblockUI);
},"top.iFrame",
{ load: {type:"script",src:"javascript/jquery.blockUI.js",test: "$.blockUI.impl.install"} },
function(){$(':disabled').removeAttr("disabled");
});});
$('#blockit').click(function(){
$.frameReady(function(){$.blockUI(); },"top.iFrame");
});
$('#unblockit').click(function(){
$.frameReady(function(){$.unblockUI(); },"top.iFrame");
});
});
</script></body></html>
editor.document.execCommand("insertHTML", false, "<br />") doesnt work when the text cursor is at the end of a sentence... but is does work when the cursor is at the middle of a sentence.
<script type="text/javascript">
window.onload = edit;
function edit() {
[code]....
I'm trying to get the cursor position to move to the end of the text within an editable iframe or div.I've been pointed to something called TextRange and have been reading up on it for days yet couldnt make sense of much (i'm still very new).what i'm trying to do is on a button click, the cursor will move to the end of the text in the iframe.
View 3 Replies View RelatedI can't get this to work, but I'm trying to update the text into an iframe on the same page with a button, for a game I'm making, the battle messages when you attack.
Here is the html file with the button and onClick
And here is the iframe page code]
This is my iframe:
How to make a scrollbar of iframe (which displays all the text you enter) to be always at bottom?
View 1 Replies View RelatedI have an iframe on a page, i am using a javascript to resize the iframe so that there isnt a scroll bar. However, when I print the page, depending on the browser, different things happen. So far, Google Chrome is the only one that pulls it off... FireFox cuts the page off and doesnt print the last 3 paragraphs and Internet Exploder shrinks a portion of the text onto the right hand side of an A4 page and ignores the last few paragraphs...
View 1 Replies View RelatedI am trying to make a comment editor with iframe, and want to trigger the change of content inside iframe, the following code cant work.code....
View 5 Replies View RelatedIm trying to use javascript history to resize an iframe when a submit button is clicked inside the iframe.
This is what i found so far.
Code:
Us this with iframe:
Code:
Code:
But im not really sure on how to apply this to my iframe, and i know that the resize part also needs to be edited, but what is missing?
Have this in parent document:
function ResizeDocument(...) {
$("iframe"
).each(function
(){ $(this
.contentWindow.document).trigger('customresize'
,null
);});
[Code]...
I am loading a collection of frames as follows (from jsp source, so ignore <%= %> blocks):
<html>
<frameset name="MNGM_OUTER" rows="50,*,20" framespacing=0
frameborder=0 border=0>
<frame name="MNGM_TOP" src="control/top.jsp" scrolling=no
[Code].....
I'd like to resize an iframe into which different (same domain) pages of differing heights are loaded. I can do a first-time resize no problem. It's the subsequent reloads that need to pass back their height to the parent page There seem to be lots of solutions for that around, but few I can see for resizing each time the iframe reloads. One is described here on another board [URL] but unfortunately the test page is no longer around (or indeed the site), so the full code is no longer available there. This one works, almost, for me: [URL] it does resize for me, but not quite sufficiently high each time - about 90% of what is required: [URL] Is there a way to add on sufficient extra margin that scrollbars no longer appear?
View 8 Replies View Related