I’ve read throught this introduction to python sockets:
http://docs.python.org/3.3/howto/sockets.html
This is my server
import socket
serversocket=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
serversocket.bind(("localhost",8000))
serversocket.listen(5)
while True:
(client,addr)=serversocket.accept()
data=serversocket.recv(1024)
print(data.decode("utf-8"))
and this is the client
import socket
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("localhost",8000))
The idea is that the server just prints all the data that was sent from the client. As you can see, I intended to encode the message strings as bytes with utf-8. But I never came that far.
With the server script running, I typed the client lines one by one into an IDLE python shell. After the third line, this error prompted up. Since I’m German, this is a vague translation. The error message will probably sound different if you can reproduce the error
Traceback (most recent call last): File «», line 1, in
s.connect((«localhost»,8000)) OSError: [WinError 10056] A connection attempt targeted an already connected socket.
How can I solve this error ? The server is slightly adapted, but the client is the exact code from the tutorial. And the error seens rather strange, after all I want the socket to be already connected — with the server . At first I thought that somehow there were already sockets connected to my server but restarting it and typing the client code again lead to the same result.
Recommended Answers
I can’t see how you’re calling these functions and what values the variables have. Post more code that demonstrates how you use these functions and I’ll have a look at it.
Jump to Post
You have threads, and a single unguarded global variable.
You have two functions with very similar names,
— sockConnect
— connectSockYour ‘state’ global variable has two flags which seem to mean the same thing.
— bool ic;
— bool inuse;Can you do what you want …
Jump to Post
Well those kinds of problems won’t go away by magic just by using threads.
Start with a simple client/server as two separate processes, talking via 127.0.0.1
http://beej.us/guide/bgnet/output/html/multipage/clientserver.htmlThen add the randomness to your send, again without using threads.
Jump to Post
All 9 Replies
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
13 Years Ago
I can’t see how you’re calling these functions and what values the variables have. Post more code that demonstrates how you use these functions and I’ll have a look at it.
13 Years Ago
void setPort(String ^port){
connectSock();
P.port=To_string(port);
args.param="";
_beginthread(sendHTTP,0,&args);
args.param="newmap=1";
_beginthread(sendHTTP,0,&args);
}
13 Years Ago
since nobody seems to be able to help me can someone give me an example of what im trying to do?
(beej doesnt help)
or point me somewhere they can help me?
Salem
5,138
Posting Sage
13 Years Ago
You have threads, and a single unguarded global variable.
You have two functions with very similar names,
— sockConnect
— connectSock
Your ‘state’ global variable has two flags which seem to mean the same thing.
— bool ic;
— bool inuse;
Can you do what you want (once) as a single thread?
Because at the moment, it’s a confused mess of half-cooked ideas all milling around as a bunch of race conditions.
13 Years Ago
i need to send traffic at random times. the packets are gathered as the user interacts
if i create a new socket when i want to send i get an error saying the socket is in use, and im using threads to send data so if i set so_reuse it wont help.
if i use one socket it gets disconnected for some reason, and when the program closes i get a fin flood.
so how do i do this????
Salem
5,138
Posting Sage
13 Years Ago
13 Years Ago
so i rewrote it without the threads, but i still get the rst issue i first got
i send 2 packets and on the 3rd it replies with rst… any thoughts on why?
Salem
5,138
Posting Sage
13 Years Ago
Not without seeing more code — no.
13 Years Ago
there is no more code- than what ive posted
void connectSock(){
psock.sockVer = MAKEWORD(1, 1);
psock.ic=false;
WSAStartup(psock.sockVer, &psock.wsaData);
char url[512];
sprintf(url, P.httpUrl.c_str());
memset(&psock.hints, 0, sizeof psock.hints);
psock.hints.ai_family = AF_UNSPEC;
psock.hints.ai_socktype = SOCK_STREAM;
getaddrinfo(url, "80", &psock.hints, &psock.srvrData);
psock.sock = socket(psock.srvrData->ai_family, psock.srvrData->ai_socktype, psock.srvrData->ai_protocol);
if (psock.sock == INVALID_SOCKET) {
closeSock(psock.sock);
P.Event="Socket fail... ";
std::stringstream outo;
outo << WSAGetLastError();
P.Event+=outo.str();
return ;
}
if(connect(psock.sock, psock.srvrData->ai_addr, psock.srvrData->ai_addrlen)<0){
P.Event="Connect Fail";
return ;
}
psock.ic=true;
}
void sendHTTP(string tpost){
if(!psock.ic)return;
try{
if(tpost.length()!=0)tpost+="&";
if(P.post.length()!=0)tpost+=P.post;
if(tpost.length()!=0)tpost+="&";
tpost+="port="+P.port;
string buffer2="POST "+P.path+" HTTP/1.0rnHost: "+P.httpUrl+"rnUser-Agent: Mozilla/4.0rnContent-Length: ";
std::stringstream outo;
outo << tpost.length();
buffer2+= outo.str();
buffer2+="rnContent-Type: application/x-www-form-urlencodedrnrn";
buffer2+=tpost;
buffer2+="n";
if(send(psock.sock, buffer2.c_str(), buffer2.length(), 0)<buffer2.length()){
P.Event="Send error ";
string s=(string)strerror(errno);
P.Event+=(s);
std::stringstream outo;
outo << WSAGetLastError();
P.Event+=outo.str();
sendHTTP( tpost);
return;
}
}catch(Exception ^ex){
}
return;
}
void setPort(String ^port){
connectSock();
P.port=To_string(port);
sendHTTP("");
sendHTTP("newmap=1");
}
Reply to this topic
Be a part of the DaniWeb community
We’re a friendly, industry-focused community of developers, IT pros, digital marketers,
and technology enthusiasts meeting, networking, learning, and sharing knowledge.
Hello guys! I am really annoyed with Mac error code 10056 which appears on my screen when I boot the system. I am detecting such alerts from last couple of weeks. Initially, I ignored the code but now it has created havoc for me. I am unable to conduct any normal task in the system and it is behaving strangely to my instructions. I need experts recommendation to protect my PC. If you have any idea about the ways to fix it then please help me. All the suggestions will be strongly appreciated. Thanks a lot in advance.
What is Mac error code 10056?
Mac is classified as one of the powerful operating system which is extremely popular among the users. It comes with lots of advanced features and allows the users to perform different types of activities at a time. Due to its user-friendly interface, it can be easily handled by the non-technical users. You can also install various applications according to your requirements. But the worst consequences appears when you will detect Mac error code 10056 on the screen. This alert will appear in hexa-decimal format which will interrupt your normal activities and system will also behave strangely. You will also find an unwanted error message which has been mentioned below:-
- elBadParkID = -10056, /* bad park id specified */
Users need to know that Mac error code 10056 comes up on the screen due to several factors including virus infection, using outdated version of applications or device drivers, damage of file system or directories, downloading suspicious files, misconfiguration of default settings and many more. If you are also facing the same alert and looking for the effective way to fix it quickly then you need to use Mac Data Recovery Software. It is one of the advanced software which is capable to perform deep scanning in order to troubleshoot the error and restore the lost files of Mac instantly. So, download the tool as early as possible.
An Introduction to Mac error code 10056 data recovery
Although Mac OS X is quite reliable, but still it is not free from glitches. Sometimes, users also have to face Mac error code 10056 data recovery issues unexpectedly. It is one issue that continues to bother irrespective of the Mac versions you might use. Eventually, as a result of it, Mac system fails to process all your request and may crash severely. What more, due to Mac error code 10056 data recovery issue, users also have to face some difficulties while accessing their hard drive files and other installed apps, which really presses a panic button at times. Wait that’s not the end, it has also been reported that system’s processing speed might get slow and even terminate abruptly, which may result in total loss of saved data on Mac. If you are also in the same situation and looking for Mac error code 10056 data recovery solution then you need not worry because you will find complete guide to fix Mac error code 10056 data recovery issue.
Mac error code 10056 data recovery: What are the Causes for Data Inaccessibility
There are various reasons behind the emergence of Mac error code 10056 data recovery creating panic situation. Any inconsistencies pertaining to Mac OS X files system might result in corruption of data thus making it completely inaccessible. Let’s take a look at some of the probable reasons for the same.
Human mistakes: It might be due to unintentional mistakes such as accidental deletion, formatting mac files and volumes during normal course of operation
Emptying Trash: Many a time users might empty their trash files without cross checking them, which might result in complete wipe of even important Mac data.
Sudden termination of system files: Some time due to power surge, Mac system gets terminated abruptly, due to which some of the files fail to mount and become unresponsive.
Interrupted read/write operation: The chances of Mac file corruption or deletion also takes place when we interrupt the ongoing read/write process in midway resulting in Mac error code 10056 data recovery situation.
Unintentional Formatting: Pressing wrong button will sometime lead to emergence of very critical Mac error code 10056 data recovery problem.
Sharing of data/file on unsupported platforms: Due to presence of unsupported platform, sometimes shared files becomes unresponsive and get corrupted.
Virus attack: Although Mac is considered lot more safe as compared to Windows but still few nasty viruses are being written for it. Downloading apps & other related files will lead to security issue, which further influence the entire file system.
Modification in BIOS setting: Sometime when we go for some changes into the BIOS sector it will lead to emergence of several erroneous situation related to Mac error code 10056 data recovery problem which you would never like to have.
Corruption in header file: Header file are one of the crucial file that contain entire information about the file that you are going to access. Hence, if there is a problem the requested file fails to respond and even generates Mac error code 10056 data recovery corruption messages.
Catalog files node corruption: Catalog is the system generated file which keep record of file type and its recent accessing type.
Problem with boot sector: When there is a problem with boot sector, Mac system fails to load and as a result you are unable to access the stored data files and there arises Mac error code 10056 data recovery issues.
Kernel Panic issues: Like BSOD in Windows, Mac users might come across kernel Panic issues.
Improper installation of program: installing of unwanted apps & programs without checking its source and agreement.
Hardware or software issue: It is also a common factor that is quite responsible for Mac file corruption and in a lieu emergence of erroneous situation.
All the above mentioned reasons are the probable causes for inaccessibility of Mac data. Now a question arises that, how a novice user know about Mac error code 10056 data recovery ? Well, for your feasibility here are given some of the common symptoms.
Symptoms Related to Mac error code 10056 data recovery
- The system will get terminated automatically after few minutes of working.
- Slow & sluggish behavior of Mac system
- The stored Mac file gets corrupted or damaged without any warning
- Installed programs gets crashed or freezes frequently
- The emergence of annoying error messages like “unable to find .dmg file”
- “file not found”
- “access denied”
Precautions & Tips For Avoiding Mac error code 10056 data recovery
There is a well known proverb that precaution is better than cure, this too is applicable in case of Mac data. In order to avoid Mac error code 10056 data recovery situation and keep all Mac files safe and secure, following tips might prove to be helpful. So, let’s have a look.
-
Stop using Mac at once if you do not want to aggravate Mac error code 10056 data recovery issue and go for inbuilt disk recovery option.
-
Never overwrite the free space created after deletion of Mac files.
-
Don’t restart the Mac as the deleted or corrupted data might get overwritten with some other file.
-
Do not switch off system by ejecting the power plug.
-
Avoid upgrading system files.
-
Do not share any new data after the deletion or corruption issue.
-
Search the Mac Trash files.
-
Avoid downloading software from untrustworthy or suspicious websites.
-
Always shutdown your PC properly.
-
Always keep your Mac system update with patches & security fixes to protect against software loopholes
-
Always have a proper & updated backup of your saved Mac files to overcome data loss and Mac error code 10056 data recovery issue.
At this juncture it has been commonly seen that the majority of users may lose their hope and get indulged in some expensive procedure for Mac error code 10056 data recovery issue. But, why to do so! If here available an effective solution for it.
In case of Mac file corruption resulting in Mac error code 10056 data recovery complications, follow this:
-
Search and launch “Disk Utility”
-
Click on “check file system”option
-
Wait till the scanning process gets over
-
Select the file that you want to mount it
2.If there is a problem with Mac file system due to Mac error code 10056 data recovery then you may try this
-
Insert the Mac Bootable CD/Flash drive and restart the PC.
-
Click on “Install Mac OS X” option.
-
Continuously press “C” button from your keyboard.
-
Accept the license agreement & select the desired language.
-
Choose the destination drive which has the problem. In general, click on “Macintosh HD”.
-
After that click on “Options” icon to select the installation method. Further, if you want to save your personal file folders, networking accounts & user accounts click on “Archive to Install” & select “Preserve Users and Network Settings.
-
Restart your Mac system and reply to configuration prompt.
Note: Attempting to fix Mac error code 10056 data recovery manually requires technical skills which newbie lacks. Even slight mistake might bring risk to data. So, it is recommended to take the help of Mac Data Recovery tool to rescue data in case of Mac error code 10056 data recovery issue.
Mac Data Recovery Software: Automatic Way to Resolve Mac error code 10056 data recovery Issue
No doubt, Mac data recovery software is an extremely simple and reliable tool that rescues data in case of its loss. It has also been noted that, the tool is quite effective in any case of data loss situation no irrespective of the reasons behind the corruption or deletion issues. Apart from that, its robust recovery algorithm performs thorough scanning of entire Mac hard drives either its internal or external and provide the users with optimum result.
Furthermore, Mac data recovery software has been well developed with layman prospective to provide simple working environment for the beginner users too. Another property of this very software is that, it can easily be installed and operate with minimal system resource utilization. In addition, due to all these effectiveness and meritorious work in the field of data recovery, the tool has gained 8 out of 10 rewards globally. Do not delay anymore, there is nothing as good as Mac data recovery software. Just download and install it to avoid Mac error code 10056 data recovery scenario.
Striking Features of Mac Data Recovery Software
Undelete Mac data: Reliable and advance tool to perform smooth recovery of Mac data/files in any Mac error code 10056 data recovery situation.
- Developed with robust scanning & recovery algorithm to provide complete Mac error code 10056 data recovery solution.
- Highly applicable in case of Mac data corruption/ deletion issue
Deleted volume recovery: Also works effectively in case of Mac system file corruption or erroneous situation
-
Enabled with advance inbuilt file searching and recovery features in a single click
RAW file recovery: Supports recovery of more than 300 popular files including spreadsheets, ZIP archives, RAR files, PPT files ,PSD files, RAW files,music files, videos, etc.
Lost partition recovery: Safe data recovery from NTFS, FAT, ExFAT, HFS, HFSX based Boot Camp Partitions
-
Works as a system start up in case of boot failure issue
-
Maintains and preserves the integrity of data
-
Also, provide the preview of scanned & recovered files along with the option to see the ongoing scanning process during Mac error code 10056 data recovery
-
Enable with resume recovery to later recovery of data from .dmg file format
-
saves recovered files at the user’s desired location
-
it is Cost effective
System Requirements for Mac data Recovery Software
- Processor: Intel
- Memory: 1GB
- Free Space on Hard Disk: 50 MB
- OS: OS X Mavericks 10.9, Mountain lion 10.8, Lion 10.7, Snow Leopard 10.6, Leopard 10.5, Tiger 10.4
Pros and Cons of the Software
Pros:
- Very easy to use
- Highly reliable
- Scan and recover entire Mac hard drive data irrespective of circumstances
- best to overcome and fix Mac error code 10056 data recovery
Cons:
- Demo version can only be used to see the preview of recovered files.
- licensed version is required for saving the recovered data on desired location.
Conclusion: Now there is no need to worry at all! You can easily be able to rescue Mac data irrespective of the circumstances behind Mac error code 10056 data recovery issue using an reliable and sophisticated Mac data recovery software.
Mac error code 10056 data recovery: Users Guide to Operate Mac Data Recovery Software
Step 1: Download and install Mac data recovery software to resolve Mac error code 10056 data recovery issue.
Step:2 click on ‘Quick Recovery’ which is located below of the tab ‘Drive Recovery’.
Step 3: Select the Mac volume to be recovered by clicking on either “Volume recovery” or “formatted recovery” option for best Mac error code 10056 data recovery solution.
Step 4: Now, click on start scan button.
Step 5: Wait till the scanning process gets over, after that a list of scanned files are displayed.
Step 6: Choose the file/folder or volume to be repaired and then select the desired location to save all recovered data and thus fix Mac error code 10056 data recovery problem.
Step:7 Progress bar will confirm the saving of selected files to the desired destination.
this is my log:
2019-02-20 22:08:28,478 — INFO — PAI — Starting Paradox Alarm Interface
2019-02-20 22:08:28,479 — INFO — PAI — Console Log level set to 10
2019-02-20 22:08:29,480 — INFO — PAI — Using IP Connection
2019-02-20 22:08:29,646 — INFO — PAI — Starting…
2019-02-20 22:08:29,647 — INFO — PAI.paradox.paradox — Connecting to interface
2019-02-20 22:08:29,654 — DEBUG — PAI.paradox.connections.ip_connection — Authenticating with IP Module
2019-02-20 22:08:29,655 — DEBUG — PAI.paradox.connections.ip_connection — PC -> IP b’aa04000309f0000001eeeeeeeeeeeeee’xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2019-02-20 22:08:34,909 — ERROR — PAI.paradox.connections.ip_connection — Unable to establish session with IP Module
Traceback (most recent call last):
File «C:paradox150pai-masterpai-masterparadoxconnectionsip_connection.py», line 138, in connect_to_panel
data = self.socket.recv(1024)
socket.timeout: timed out
2019-02-20 22:08:34,913 — ERROR — PAI.paradox.connections.ip_connection — Try 2/3. Unable to connect to IP Module
Traceback (most recent call last):
File «C:paradox150pai-masterpai-masterparadoxconnectionsip_connection.py», line 60, in connect
self.socket.connect((self.host, self.port))
OSError: [WinError 10056] A connect request was made on an already connected socket
2019-02-20 22:08:34,918 — ERROR — PAI.paradox.connections.ip_connection — Try 3/3. Unable to connect to IP Module
Traceback (most recent call last):
File «C:paradox150pai-masterpai-masterparadoxconnectionsip_connection.py», line 60, in connect
self.socket.connect((self.host, self.port))
OSError: [WinError 10056] A connect request was made on an already connected socket
it seems that after it sends the first packet after connecting to the module and tries to read stream from the socket, it receives the exception, cause there is nothing to read..i tries to put some delay in between send and recv but did not help.
Я прочитал это введение в сокеты Python: http://docs.python.org/3.3/howto/sockets.html
Это мой сервер
import socket
serversocket=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
serversocket.bind(("localhost",8000))
serversocket.listen(5)
while True:
(client,addr)=serversocket.accept()
data=serversocket.recv(1024)
print(data.decode("utf-8"))
А это клиент
import socket
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("localhost",8000))
Идея заключается в том, что сервер просто печатает все данные, которые были отправлены с клиента. Как видите, я намеревался закодировать строки сообщений в байты с помощью utf-8. Но я никогда не заходил так далеко.
Запустив серверный скрипт, я набрал клиентские строки одну за другой в оболочку Python IDLE. После третьей строки выдается эта ошибка. Так как я немец, это неопределенный перевод. Сообщение об ошибке, вероятно, будет звучать иначе, если вы можете воспроизвести ошибку
Traceback (последний вызов был последним): файл «», строка 1, в s.connect ((«localhost», 8000)) OSError: [WinError 10056] Попытка подключения нацелена на уже подключенный сокет.
Как я могу решить эту ошибку? Сервер немного адаптирован, но клиент является точным кодом из учебника. И ошибка выглядит довольно странно, ведь я хочу, чтобы сокет уже был связан — с сервером. Сначала я подумал, что каким-то образом к моему серверу уже были подключены сокеты, но перезапуск и повторный ввод клиентского кода привели к тому же результату.
2 ответа
Лучший ответ
Вы хотите получить на клиентском сокете и закрыть клиентский сокет, когда клиент закрывается. Это будет обрабатывать по одному клиенту за раз, но учтите, что ему действительно нужен протокол сообщений, чтобы знать, что он имеет полное сообщение для декодирования:
import socket
serversocket = socket.socket()
serversocket.bind(('',8000))
serversocket.listen(5)
while True:
client,addr = serversocket.accept()
while True:
data = client.recv(1024)
if not data: break
print(data.decode('utf8')) # Note this might not contain a complete UTF-8 character.
client.close()
2
Jachdich
10 Мар 2018 в 17:30
Вы не хотите вызывать recv () в сокете, в котором вы вызываете listen () и accept (). Вместо этого используйте только что подключенный клиент.
1
Ulrich Eckhardt
14 Май 2013 в 20:43
Я хочу автоматизировать подключение. Столкнувшись с проблемой ниже при запуске кода. попытался добавить отключение, но это не сработало. Система подключается, и данные передаются. как только соединение потеряно и когда система пытается восстановить соединение, я сталкиваюсь с проблемой.
import socket,time
client=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
client.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
ip = '192.168.xx.x'
port = 4xxx
address = (ip,port)
def connect():
try:
while 1:
print("connecting")
try:
client.connect(address)
print("connected")
except TimeoutError:
print("wait for few mins")
time.sleep(20)
connect()
break
except ConnectionAbortedError:
print("connection aborted wait for few sec")
time.sleep(10)
connect()
connect()
try:
while 1:
datasent = client.send(b'x01x04')
if datasent:
print("sent")
data= client.recv(1024)
print(data)
time.sleep(5)
if not datasent:
connect()
except ConnectionResetError:
client.shutdown(socket.SHUT_RDWR)
client.close()
print("wait for 10 sec")
time.sleep(10)
connect()
>Error: Traceback (most recent call last):
File "C:UsersUsereclipse-workspaceDatackeckclient.py", line 28, in <module>
datasent = client.send(b'x01x04')
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:UsersUsereclipse-workspaceDatackeckclient.py", line 41, in <module>
connect()
File "C:UsersUsereclipse-workspaceDatackeckclient.py", line 13, in connect
client.connect(address)
OSError: [WinError 10038] An operation was attempted on something that is not a socket
windows — python socket: winerror 10056 —
i’ve read throught introduction python sockets: http://docs.python.org/3.3/howto/sockets.html
this server
import socket serversocket=socket.socket(socket.af_inet,socket.sock_stream) serversocket.bind(("localhost",8000)) serversocket.listen(5) while true: (client,addr)=serversocket.accept() data=serversocket.recv(1024) print(data.decode("utf-8"))
and client
import socket s=socket.socket(socket.af_inet, socket.sock_stream) s.connect(("localhost",8000))
the idea server prints data sent client. can see, intended encode message strings bytes utf-8. never came far.
with server script running, typed client lines 1 one idle python shell. after third line, error prompted up. since i’m german, vague translation. error message sound different if can reproduce error
traceback (most recent call last): file «», line 1, in s.connect((«localhost»,8000)) oserror: [winerror 10056] connection attempt targeted connected socket.
how can solve error ? server adapted, client exact code tutorial. , error seens rather strange, after want socket connected — server . @ first thought somehow there sockets connected server restarting , typing client code again lead same result.
you want receive on client socket, , close client socket when client closes. process 1 client @ time, note needs message protocol implemented know has complete message decode:
import socket serversocket = socket.socket() serversocket.bind(('',8000)) serversocket.listen(5) while true: client,addr = serversocket.accept() while true: data = client.recv(1024) if not data: break print(data.decode('utf8') # note might not contain complete utf-8 char. client.close()
Popular posts from this blog
html — Border-Radius is not Aligning Properly —
i trying create div rounded corners. inside div contains additional content fill height of div. i’ve noticed there visual corruption @ each corner of rounded div. looks me corner of outer div lightly larger inner div. according code, border-radius of both divs should identical. example of issue: http://jsfiddle.net/mrzaf/4/ image of issue: http://imgur.com/ph6ihlc <div class=»a-a»> <div class=»a-b»>content in here</div> </div> <br><br> <div class=»b-a»> <div class=»b-b»>content in here</div> </div> div.a-a { background:red; border-radius:10px; width:400px; } div.a-b { background:aqua; border-radius:10px; height:200px; } div.b-a { background:red; border-radius:10px; width:400px; overflow:hidden; } div.b-b { background:aqua; width:400px; height:200px; } there couple of option this. first option : increase border-radius of parent container div.a-a { b
jquery — How can I dynamically add a browser tab? —
since using iframes house external pages are, accounts «not preferred method» , disallowed sites (flickr, one), want dynamically generate browser tabs. e.g., when user submits form, want dynamically generate tab on browser in response submitted. e.g., might want add new tab url like: http://www.bigsurgarrapata.com/contact how in jquery? you want form target attribute action attribute. http://www.w3schools.com/tags/att_form_target.asp browsers have ultimate control on result of target attribute open new tab value of _blank. <form action=»contact_submit.php» target=»_blank» method=»post»>
javascript — google.elements.newsShow display Time not working —
i trying use google newsshow api display news in html app. here code <html xmlns=»http://www.w3.org/1999/xhtml»> <head> <meta http-equiv=»content-type» content=»text/html; charset=utf-8″/> <title>google ajax search api sample</title> <script src=»http://www.google.com/jsapi?key=aizasya5m1nc8ws2bbmprwku5gfradvd_hgq6g0″ type=»text/javascript»></script> <script type=»text/javascript»> google.load(«elements», «1», {packages : [«newsshow»]}); function onload() { // set display time 2 seconds, , transition time 100 ms var options = { «querylist» : [ { «title» : «indian news», «topic» : «n», «ned» : «in» } ], «displaytime» : 1000, «transitiontime» : 50 } var content = document.getelem